fix(SW-672): Added nullable and default values to schema to avoid validation issues from ContentStack with changed models
This commit is contained in:
@@ -369,16 +369,16 @@ export const validateFooterConfigSchema = z
|
||||
all_footer: z.object({
|
||||
items: z.array(
|
||||
z.object({
|
||||
main_links: validateLinks,
|
||||
main_links: validateLinks.default([]),
|
||||
app_downloads: z.object({
|
||||
title: z.string(),
|
||||
links: validateLinksWithType,
|
||||
links: validateLinksWithType.default([]),
|
||||
}),
|
||||
secondary_links: validateSecondaryLinks,
|
||||
secondary_links: validateSecondaryLinks.default([]),
|
||||
social_media: z.object({
|
||||
links: validateLinksWithType,
|
||||
links: validateLinksWithType.default([]),
|
||||
}),
|
||||
tertiary_links: validateLinks,
|
||||
tertiary_links: validateLinks.default([]),
|
||||
})
|
||||
),
|
||||
}),
|
||||
@@ -418,25 +418,31 @@ export const validateFooterRefConfigSchema = z.object({
|
||||
items: z
|
||||
.array(
|
||||
z.object({
|
||||
main_links: z.array(
|
||||
z.object({
|
||||
pageConnection: pageConnectionRefs,
|
||||
})
|
||||
),
|
||||
secondary_links: z.array(
|
||||
z.object({
|
||||
links: z.array(
|
||||
z.object({
|
||||
pageConnection: pageConnectionRefs,
|
||||
})
|
||||
),
|
||||
})
|
||||
),
|
||||
tertiary_links: z.array(
|
||||
z.object({
|
||||
pageConnection: pageConnectionRefs,
|
||||
})
|
||||
),
|
||||
main_links: z
|
||||
.array(
|
||||
z.object({
|
||||
pageConnection: pageConnectionRefs,
|
||||
})
|
||||
)
|
||||
.nullable(),
|
||||
secondary_links: z
|
||||
.array(
|
||||
z.object({
|
||||
links: z.array(
|
||||
z.object({
|
||||
pageConnection: pageConnectionRefs,
|
||||
})
|
||||
),
|
||||
})
|
||||
)
|
||||
.nullable(),
|
||||
tertiary_links: z
|
||||
.array(
|
||||
z.object({
|
||||
pageConnection: pageConnectionRefs,
|
||||
})
|
||||
)
|
||||
.nullable(),
|
||||
system: systemSchema,
|
||||
})
|
||||
)
|
||||
|
||||
@@ -31,7 +31,8 @@ export const hotelFaqSchema = z
|
||||
.object({
|
||||
questions: accordionItemsSchema,
|
||||
})
|
||||
.optional(),
|
||||
.optional()
|
||||
.nullable(),
|
||||
})
|
||||
.transform((data) => {
|
||||
const array = []
|
||||
@@ -51,7 +52,7 @@ export const hotelFaqRefsSchema = z
|
||||
.optional()
|
||||
.default(HotelPageEnum.ContentStack.blocks.Faq),
|
||||
global_faqConnection: globalAccordionConnectionRefs.optional(),
|
||||
specific_faq: specificAccordionConnectionRefs.optional(),
|
||||
specific_faq: specificAccordionConnectionRefs.optional().nullable(),
|
||||
})
|
||||
.transform((data) => {
|
||||
const array = []
|
||||
|
||||
Reference in New Issue
Block a user