Skip to content

Commit

Permalink
fix(UserDetailEditor): enforce full name
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianAndersen committed Aug 19, 2024
1 parent c2c0521 commit 50da90b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/user/user-detail-editor/YourInfoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const YourInfoSection = ({
autoComplete="name"
fullWidth
id="name"
label="Navn"
label="Fullt navn"
error={!!errors.name}
{...register("name", fieldValidators.name)}
/>
Expand Down
6 changes: 5 additions & 1 deletion src/components/user/user-detail-editor/fieldValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 50da90b

Please sign in to comment.