fix: get joinloyalty button from contentstack

This commit is contained in:
Christel Westerberg
2024-07-02 13:11:06 +02:00
parent 1e3bbed6d1
commit d7b87585b9
5 changed files with 119 additions and 23 deletions
@@ -152,6 +152,14 @@ const loyaltyPageJoinLoyaltyContact = z.object({
join_loyalty_contact: z.object({
title: z.string().nullable(),
preamble: z.string().nullable(),
button: z
.object({
openInNewTab: z.boolean(),
title: z.string(),
href: z.string(),
isExternal: z.boolean(),
})
.nullable(),
contact: z.array(
z.object({
__typename: z.literal(
@@ -362,8 +370,22 @@ const loyaltyPageSidebarTextContentRef = z.object({
}),
})
const loyaltyPageSidebarJoinLoyaltyContactRef = z.object({
__typename: z.literal(
SidebarTypenameEnum.LoyaltyPageSidebarJoinLoyaltyContact
),
join_loyalty_contact: z.object({
button: z
.object({
linkConnection: pageConnectionRefs,
})
.nullable(),
}),
})
const loyaltyPageSidebarRefsItem = z.discriminatedUnion("__typename", [
loyaltyPageSidebarTextContentRef,
loyaltyPageSidebarJoinLoyaltyContactRef,
])
export const validateLoyaltyPageRefsSchema = z.object({