fix(SW-672): Added nullable and default values to schema to avoid validation issues from ContentStack with changed models
This commit is contained in:
@@ -88,7 +88,7 @@ export default function TabNavigation({
|
|||||||
scroll={true}
|
scroll={true}
|
||||||
onClick={pauseScrollSpy}
|
onClick={pauseScrollSpy}
|
||||||
>
|
>
|
||||||
{intl.formatMessage({ id: link.text })}
|
{link.text}
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
"mapContainer";
|
"mapContainer";
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
max-width: var(--max-width);
|
max-width: var(--max-width);
|
||||||
z-index: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hotelImages {
|
.hotelImages {
|
||||||
|
|||||||
@@ -369,16 +369,16 @@ export const validateFooterConfigSchema = z
|
|||||||
all_footer: z.object({
|
all_footer: z.object({
|
||||||
items: z.array(
|
items: z.array(
|
||||||
z.object({
|
z.object({
|
||||||
main_links: validateLinks,
|
main_links: validateLinks.default([]),
|
||||||
app_downloads: z.object({
|
app_downloads: z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
links: validateLinksWithType,
|
links: validateLinksWithType.default([]),
|
||||||
}),
|
}),
|
||||||
secondary_links: validateSecondaryLinks,
|
secondary_links: validateSecondaryLinks.default([]),
|
||||||
social_media: z.object({
|
social_media: z.object({
|
||||||
links: validateLinksWithType,
|
links: validateLinksWithType.default([]),
|
||||||
}),
|
}),
|
||||||
tertiary_links: validateLinks,
|
tertiary_links: validateLinks.default([]),
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
@@ -418,12 +418,15 @@ export const validateFooterRefConfigSchema = z.object({
|
|||||||
items: z
|
items: z
|
||||||
.array(
|
.array(
|
||||||
z.object({
|
z.object({
|
||||||
main_links: z.array(
|
main_links: z
|
||||||
|
.array(
|
||||||
z.object({
|
z.object({
|
||||||
pageConnection: pageConnectionRefs,
|
pageConnection: pageConnectionRefs,
|
||||||
})
|
})
|
||||||
),
|
)
|
||||||
secondary_links: z.array(
|
.nullable(),
|
||||||
|
secondary_links: z
|
||||||
|
.array(
|
||||||
z.object({
|
z.object({
|
||||||
links: z.array(
|
links: z.array(
|
||||||
z.object({
|
z.object({
|
||||||
@@ -431,12 +434,15 @@ export const validateFooterRefConfigSchema = z.object({
|
|||||||
})
|
})
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
),
|
)
|
||||||
tertiary_links: z.array(
|
.nullable(),
|
||||||
|
tertiary_links: z
|
||||||
|
.array(
|
||||||
z.object({
|
z.object({
|
||||||
pageConnection: pageConnectionRefs,
|
pageConnection: pageConnectionRefs,
|
||||||
})
|
})
|
||||||
),
|
)
|
||||||
|
.nullable(),
|
||||||
system: systemSchema,
|
system: systemSchema,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ export const hotelFaqSchema = z
|
|||||||
.object({
|
.object({
|
||||||
questions: accordionItemsSchema,
|
questions: accordionItemsSchema,
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional()
|
||||||
|
.nullable(),
|
||||||
})
|
})
|
||||||
.transform((data) => {
|
.transform((data) => {
|
||||||
const array = []
|
const array = []
|
||||||
@@ -51,7 +52,7 @@ export const hotelFaqRefsSchema = z
|
|||||||
.optional()
|
.optional()
|
||||||
.default(HotelPageEnum.ContentStack.blocks.Faq),
|
.default(HotelPageEnum.ContentStack.blocks.Faq),
|
||||||
global_faqConnection: globalAccordionConnectionRefs.optional(),
|
global_faqConnection: globalAccordionConnectionRefs.optional(),
|
||||||
specific_faq: specificAccordionConnectionRefs.optional(),
|
specific_faq: specificAccordionConnectionRefs.optional().nullable(),
|
||||||
})
|
})
|
||||||
.transform((data) => {
|
.transform((data) => {
|
||||||
const array = []
|
const array = []
|
||||||
|
|||||||
Reference in New Issue
Block a user