diff --git a/src/components/user/user-detail-editor/YourInfoSection.tsx b/src/components/user/user-detail-editor/YourInfoSection.tsx index 8093bdd..b71e90e 100644 --- a/src/components/user/user-detail-editor/YourInfoSection.tsx +++ b/src/components/user/user-detail-editor/YourInfoSection.tsx @@ -48,7 +48,7 @@ const YourInfoSection = ({ autoComplete="name" fullWidth id="name" - label="Navn" + label="Fullt navn" error={!!errors.name} {...register("name", fieldValidators.name)} /> diff --git a/src/components/user/user-detail-editor/fieldValidators.ts b/src/components/user/user-detail-editor/fieldValidators.ts index 053851c..03f2345 100644 --- a/src/components/user/user-detail-editor/fieldValidators.ts +++ b/src/components/user/user-detail-editor/fieldValidators.ts @@ -23,7 +23,11 @@ export const fieldValidators: { }, }, name: { - required: "Du må fylle inn navn", + required: "Du må fylle inn ditt fulle navn", + validate: (v: string) => + v.split(" ").length > 1 + ? true + : "Du må fylle inn både fornavn og etternavn", }, phoneNumber: { required: "Du må fylle inn telefonnummer",