fix: make web and breadcrumbs optional

This commit is contained in:
Matilda Landström
2024-06-03 13:59:24 +02:00
parent a0a4cf18cf
commit b8d540aaa1
4 changed files with 59 additions and 44 deletions

View File

@@ -13,22 +13,25 @@ export const getBreadcrumbsSchema = z.array(
const breadcrumbsRefsItems = z.object({
items: z.array(
z.object({
web: z.object({
breadcrumbs: z.object({
parentsConnection: z.object({
edges: z.array(
z.object({
node: z.object({
system: z.object({
content_type_uid: z.string(),
uid: z.string(),
web: z
.object({
breadcrumbs: z.object({
title: z.string(),
parentsConnection: z.object({
edges: z.array(
z.object({
node: z.object({
system: z.object({
content_type_uid: z.string(),
uid: z.string(),
}),
}),
}),
})
),
})
),
}),
}),
}),
}),
})
.optional(),
system: z.object({
content_type_uid: z.string(),
uid: z.string(),
@@ -48,29 +51,33 @@ export const validateLoyaltyPageBreadcrumbsRefsContentstackSchema = z.object({
})
const page = z.object({
web: z.object({
breadcrumbs: z.object({
title: z.string(),
parentsConnection: z.object({
edges: z.array(
z.object({
node: z.object({
web: z.object({
breadcrumbs: z.object({
title: z.string(),
web: z
.object({
breadcrumbs: z
.object({
title: z.string(),
parentsConnection: z.object({
edges: z.array(
z.object({
node: z.object({
web: z.object({
breadcrumbs: z.object({
title: z.string(),
}),
}),
system: z.object({
locale: z.nativeEnum(Lang),
uid: z.string(),
}),
url: z.string(),
}),
}),
system: z.object({
locale: z.nativeEnum(Lang),
uid: z.string(),
}),
url: z.string(),
}),
})
),
}),
}),
}),
})
),
}),
})
.optional(),
})
.optional(),
system: z.object({
uid: z.string(),
}),