Merged in fix/profile-validation (pull request #488)
fix: default language if missing in profile Approved-by: Michael Zetterberg Approved-by: Tobias Johansson Approved-by: Arvid Norlin Approved-by: Matilda Landström
This commit is contained in:
@@ -7,6 +7,7 @@ import { FormProvider, useForm } from "react-hook-form"
|
||||
import { usePhoneInput } from "react-international-phone"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { type Lang, langToApiLang } from "@/constants/languages"
|
||||
import { profile } from "@/constants/routes/myPages"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
@@ -25,7 +26,6 @@ import {
|
||||
type EditFormProps,
|
||||
Status,
|
||||
} from "@/types/components/myPages/myProfile/edit"
|
||||
import type { Lang } from "@/constants/languages"
|
||||
|
||||
const formId = "edit-profile"
|
||||
|
||||
@@ -61,7 +61,7 @@ export default function Form({ user }: EditFormProps) {
|
||||
},
|
||||
dateOfBirth: user.dateOfBirth,
|
||||
email: user.email,
|
||||
language: user.language,
|
||||
language: user.language ?? langToApiLang[lang],
|
||||
phoneNumber: phoneInput,
|
||||
password: "",
|
||||
newPassword: "",
|
||||
|
||||
Reference in New Issue
Block a user