fix(SW-1830): Adjusted schemas for city and country pages to accept less data

* fix(SW-1830): Adjusted schemas for city and country pages to accept less data


Approved-by: Fredrik Thorsson
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-03-08 07:53:39 +00:00
parent 63ea994f43
commit d45487a3c7
6 changed files with 76 additions and 58 deletions

View File

@@ -63,28 +63,31 @@ export const destinationCountryPageSchema = z.object({
images
.map((image) => image.image)
.filter((image): image is ImageVaultAsset => !!image)
),
)
.nullish(),
has_sidepeek: z.boolean().default(false),
sidepeek_button_text: z.string().default(""),
sidepeek_content: z.object({
heading: z.string(),
content: z.object({
json: z.any(),
embedded_itemsConnection: z.object({
edges: z.array(
z.object({
node: linkUnionSchema.transform((data) => {
const link = transformPageLink(data)
if (link) {
return link
}
return data
}),
})
),
sidepeek_button_text: z.string().nullish(),
sidepeek_content: z
.object({
heading: z.string(),
content: z.object({
json: z.any(),
embedded_itemsConnection: z.object({
edges: z.array(
z.object({
node: linkUnionSchema.transform((data) => {
const link = transformPageLink(data)
if (link) {
return link
}
return data
}),
})
),
}),
}),
}),
}),
})
.nullish(),
blocks: discriminatedUnionArray(blocksSchema.options).nullable(),
system: systemSchema.merge(
z.object({