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
@@ -37,6 +37,10 @@ async function getLoyaltyPageBreadcrumbs(variables: Variables) {
variables
)
if (!refsResponse.data.all_loyalty_page.items[0].web?.breadcrumbs?.title) {
return []
}
const validatedRefsData =
validateLoyaltyPageBreadcrumbsRefsContentstackSchema.safeParse(
refsResponse.data