fix: handle undefined values schemas
This commit is contained in:
@@ -37,14 +37,16 @@ export const restaurantSchema = z
|
||||
.object({
|
||||
attributes: z.object({
|
||||
name: z.string().optional(),
|
||||
isPublished: z.boolean(),
|
||||
isPublished: z.boolean().default(false),
|
||||
email: z.string().optional(),
|
||||
phoneNumber: z.string().optional(),
|
||||
externalBreakfast: z.object({
|
||||
isAvailable: z.boolean(),
|
||||
localPriceForExternalGuests: restaurantPriceSchema.optional(),
|
||||
requestedPriceForExternalGuests: restaurantPriceSchema.optional(),
|
||||
}),
|
||||
externalBreakfast: z
|
||||
.object({
|
||||
isAvailable: z.boolean(),
|
||||
localPriceForExternalGuests: restaurantPriceSchema.optional(),
|
||||
requestedPriceForExternalGuests: restaurantPriceSchema.optional(),
|
||||
})
|
||||
.optional(),
|
||||
menus: z
|
||||
.array(
|
||||
z.object({
|
||||
@@ -53,7 +55,7 @@ export const restaurantSchema = z
|
||||
})
|
||||
)
|
||||
.default([]),
|
||||
openingDetails: z.array(restaurantOpeningDetailSchema),
|
||||
openingDetails: z.array(restaurantOpeningDetailSchema).default([]),
|
||||
content: z.object({
|
||||
images: z.array(imageSchema),
|
||||
texts: z.object({
|
||||
|
||||
Reference in New Issue
Block a user