From ea130ffaf8094260b3a0012313916bc4bb7c3806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Thu, 2 Oct 2025 06:34:46 +0000 Subject: [PATCH] Merged in feat/LOY-362-content-block (pull request #2897) feat(LOY-362): fix content block * feat(LOY-362): fix content block Approved-by: Chuma Mcphoy (We Ahead) --- .../trpc/lib/graphql/Fragments/Blocks/Content.graphql | 10 ++++++++-- .../Query/PromoCampaignPage/PromoCampaignPage.graphql | 2 ++ .../routers/contentstack/promoCampaignPage/output.ts | 10 +++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/trpc/lib/graphql/Fragments/Blocks/Content.graphql b/packages/trpc/lib/graphql/Fragments/Blocks/Content.graphql index 87545732f..b6db78f10 100644 --- a/packages/trpc/lib/graphql/Fragments/Blocks/Content.graphql +++ b/packages/trpc/lib/graphql/Fragments/Blocks/Content.graphql @@ -285,7 +285,7 @@ fragment Content_DestinationFilterBlocksRefs on DestinationFilterBlocksContent { } } -fragment Content_PromoCampaign on PromoCampaignPageBlocksContent { +fragment Content_PromoCampaignPage on PromoCampaignPageBlocksContent { content { content { embedded_itemsConnection { @@ -297,6 +297,9 @@ fragment Content_PromoCampaign on PromoCampaignPageBlocksContent { ...CampaignPageLink ...CollectionPageLink ...ContentPageLink + ...DestinationCityPageLink + ...DestinationCountryPageLink + ...DestinationOverviewPageLink ...HotelPageLink ...LoyaltyPageLink ...StartPageLink @@ -308,7 +311,7 @@ fragment Content_PromoCampaign on PromoCampaignPageBlocksContent { } } -fragment Content_PromoCampaignRefs on PromoCampaignPageBlocksContent { +fragment Content_PromoCampaignPageRefs on PromoCampaignPageBlocksContent { content { content { embedded_itemsConnection { @@ -320,6 +323,9 @@ fragment Content_PromoCampaignRefs on PromoCampaignPageBlocksContent { ...CampaignPageRef ...CollectionPageRef ...ContentPageRef + ...DestinationCityPageRef + ...DestinationCountryPageRef + ...DestinationOverviewPageRef ...HotelPageRef ...LoyaltyPageRef ...StartPageRef diff --git a/packages/trpc/lib/graphql/Query/PromoCampaignPage/PromoCampaignPage.graphql b/packages/trpc/lib/graphql/Query/PromoCampaignPage/PromoCampaignPage.graphql index 7f20a0a86..4619b37df 100644 --- a/packages/trpc/lib/graphql/Query/PromoCampaignPage/PromoCampaignPage.graphql +++ b/packages/trpc/lib/graphql/Query/PromoCampaignPage/PromoCampaignPage.graphql @@ -24,6 +24,7 @@ query GetPromoCampaignPage($locale: String!, $uid: String!) { blocks { __typename ...Accordion_PromoCampaignPage + ...Content_PromoCampaignPage } system { ...System @@ -41,6 +42,7 @@ query GetPromoCampaignPageRefs($locale: String!, $uid: String!) { blocks { __typename ...Accordion_PromoCampaignPageRefs + ...Content_PromoCampaignPageRefs } system { ...System diff --git a/packages/trpc/lib/routers/contentstack/promoCampaignPage/output.ts b/packages/trpc/lib/routers/contentstack/promoCampaignPage/output.ts index 08dfcd6bb..3243c1dd8 100644 --- a/packages/trpc/lib/routers/contentstack/promoCampaignPage/output.ts +++ b/packages/trpc/lib/routers/contentstack/promoCampaignPage/output.ts @@ -11,7 +11,7 @@ import { accordionSchema, } from "../schemas/blocks/accordion" import { - //contentRefsSchema as blockContentRefsSchema, + contentRefsSchema as blockContentRefsSchema, contentSchema as blockContentSchema, } from "../schemas/blocks/content" import { systemSchema } from "../schemas/system" @@ -30,7 +30,7 @@ export const promoCampaignPageAccordion = z export const blocksSchema = z.discriminatedUnion("__typename", [ promoCampaignPageAccordion, - //promoCampaignPageContent, + promoCampaignPageContent, ]) export const CAMPAIGN_TYPES = { @@ -98,11 +98,11 @@ export const promoCampaignPageSchema = z }) /** REFS */ -/*const promoCampaignPageBlockContentRefs = z +const promoCampaignPageBlockContentRefs = z .object({ __typename: z.literal(PromoCampaignPageEnum.ContentStack.blocks.Content), }) - .merge(blockContentRefsSchema)*/ + .merge(blockContentRefsSchema) const promoCampaignPageAccordionRefs = z .object({ @@ -112,7 +112,7 @@ const promoCampaignPageAccordionRefs = z const promoCampaignPageBlockRefsItem = z.discriminatedUnion("__typename", [ promoCampaignPageAccordionRefs, - //promoCampaignPageBlockContentRefs, + promoCampaignPageBlockContentRefs, ]) export const promoCampaignPageRefsSchema = z.object({