fix: make special requests block togglable

This commit is contained in:
Christel Westerberg
2024-12-12 11:42:06 +01:00
parent 4872847ecb
commit a1a36e80d5
6 changed files with 166 additions and 74 deletions

View File

@@ -20,8 +20,14 @@ export enum ElevatorPreference {
const specialRequestsSchema = z
.object({
floorPreference: z.nativeEnum(FloorPreference).optional(),
elevatorPreference: z.nativeEnum(ElevatorPreference).optional(),
floorPreference: z
.nativeEnum(FloorPreference)
.or(z.literal("").transform((_) => undefined))
.optional(),
elevatorPreference: z
.nativeEnum(ElevatorPreference)
.or(z.literal("").transform((_) => undefined))
.optional(),
comments: z.string().default(""),
})
.optional()