Skip to content

Commit

Permalink
Refine dataschema
Browse files Browse the repository at this point in the history
  • Loading branch information
norda-gunni committed Dec 13, 2024
1 parent 34ebbd9 commit 11c905b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ export const ExampleSchema = z.object({
z.object({
nationalIdWithName: z.object({
name: z.string().min(1).max(256),
nationalId: z.string().min(1).max(256),
phone: z.string().min(1).max(256),
nationalId: z.string().refine((n) => n && kennitala.isValid(n), {
params: m.dataSchemeNationalId,
}),
phone: z.string().refine(isValidNumber, {
params: m.dataSchemePhoneNumber,
}),
email: z.string().email(),
}),
}),
Expand Down

0 comments on commit 11c905b

Please sign in to comment.