Skip to content

Commit

Permalink
refactor: make optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jorelosorio committed Oct 23, 2024
1 parent 010e01a commit 989e6e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions schema-definitions/other.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
},
"contactPhoneNumber": {
"type": "string",
"pattern": "^\\+\\d{1,3}\\d{1,14}$",
"default": ""
"pattern": "^\\+\\d{1,3}\\d{1,14}$"
},
"enableNynorsk": {
"type": "boolean"
Expand Down Expand Up @@ -198,8 +197,7 @@
}
},
"required": [
"vatPercent",
"contactPhoneNumber"
"vatPercent"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
Expand Down
2 changes: 1 addition & 1 deletion src/other.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const LoginMethod = z.enum(['otp', 'email', 'vipps']);
export const Other = z.object({
vatPercent: z.number(),
enableTokenToggleRestrictions: z.boolean().optional(),
contactPhoneNumber: z.string().regex(/^\+\d{1,3}\d{1,14}$/).default(""),
contactPhoneNumber: z.string().regex(/^\+\d{1,3}\d{1,14}$/).optional(),
enableNynorsk: z.boolean().optional(),
tokenToggleMaxLimit: z.number().optional(),
travelcardNumberLength: z.number().default(16),
Expand Down

0 comments on commit 989e6e9

Please sign in to comment.