diff --git a/apps/scandic-web/lib/graphql/Fragments/Blocks/Accordion.graphql b/apps/scandic-web/lib/graphql/Fragments/Blocks/Accordion.graphql index e8f3b7400..619124266 100644 --- a/apps/scandic-web/lib/graphql/Fragments/Blocks/Accordion.graphql +++ b/apps/scandic-web/lib/graphql/Fragments/Blocks/Accordion.graphql @@ -1,3 +1,5 @@ +#import "../Image.graphql" + #import "../PageLink/AccountPageLink.graphql" #import "../PageLink/CollectionPageLink.graphql" #import "../PageLink/ContentPageLink.graphql" @@ -31,6 +33,7 @@ fragment AccordionBlock on Accordion { edges { node { __typename + ...Image ...AccountPageLink ...CollectionPageLink ...ContentPageLink @@ -57,6 +60,7 @@ fragment GlobalAccordionBlock on GlobalAccordion { edges { node { __typename + ...Image ...AccountPageLink ...CollectionPageLink ...ContentPageLink @@ -109,6 +113,7 @@ fragment SpecificAccordion_ContentPage on ContentPageBlocksAccordionBlockAccordi edges { node { __typename + ...Image ...AccountPageLink ...CollectionPageLink ...ContentPageLink @@ -209,6 +214,7 @@ fragment SpecificAccordion_DestinationCityPage on DestinationCityPageBlocksAccor edges { node { __typename + ...Image ...AccountPageLink ...CollectionPageLink ...ContentPageLink @@ -309,6 +315,7 @@ fragment SpecificAccordion_DestinationCountryPage on DestinationCountryPageBlock edges { node { __typename + ...Image ...AccountPageLink ...CollectionPageLink ...ContentPageLink diff --git a/apps/scandic-web/server/routers/contentstack/schemas/blocks/accordion.ts b/apps/scandic-web/server/routers/contentstack/schemas/blocks/accordion.ts index 7529d7d79..f5e84da59 100644 --- a/apps/scandic-web/server/routers/contentstack/schemas/blocks/accordion.ts +++ b/apps/scandic-web/server/routers/contentstack/schemas/blocks/accordion.ts @@ -5,9 +5,12 @@ import { linkUnionSchema, transformPageLink, } from "../pageLinks" +import { imageSchema } from "./image" import { BlocksEnums } from "@/types/enums/blocks" +export const embeddedContentSchema = z.union([linkUnionSchema, imageSchema]) + export const accordionItemsSchema = z.array( z.object({ question: z.string(), @@ -16,7 +19,7 @@ export const accordionItemsSchema = z.array( embedded_itemsConnection: z.object({ edges: z.array( z.object({ - node: linkUnionSchema.transform((data) => { + node: embeddedContentSchema.transform((data) => { const link = transformPageLink(data) if (link) { return link