Skip to content

Commit

Permalink
Add validation to plateSize field to make sure either front or rear i…
Browse files Browse the repository at this point in the history
…s selected
  • Loading branch information
johannaagma committed Nov 19, 2024
1 parent 03a7d77 commit ff6c7d5
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ export const OrderVehicleLicensePlateSchema = z.object({
plate: z.string(),
type: z.string(),
}),
plateSize: z.object({
frontPlateSize: z.array(z.string()),
rearPlateSize: z.array(z.string()),
}),
plateSize: z
.object({
frontPlateSize: z.array(z.string()),
rearPlateSize: z.array(z.string()),
})
.refine(({ frontPlateSize, rearPlateSize }) => {
return frontPlateSize.length !== 0 || rearPlateSize.length !== 0
}),
plateDelivery: z.object({
deliveryMethodIsDeliveryStation: z.enum([YES, NO]),
deliveryStationTypeCode: z.string().optional(),
Expand Down

0 comments on commit ff6c7d5

Please sign in to comment.