Merged in feature/tier-matching-component (pull request #1175)

SAS Tier matching comparison block (SW-921)

Approved-by: Joakim Jäderberg
Approved-by: Matilda Landström
This commit is contained in:
Anton Gunnarsson
2025-01-22 08:15:31 +00:00
parent dc115ca368
commit eacca33847
13 changed files with 416 additions and 1 deletions
@@ -18,6 +18,7 @@ import {
dynamicContentRefsSchema,
dynamicContentSchema as blockDynamicContentSchema,
} from "../schemas/blocks/dynamicContent"
import { sasTierComparisonSchema } from "../schemas/blocks/sasTierComparison"
import { hotelListingSchema } from "../schemas/blocks/hotelListing"
import {
shortcutsRefsSchema,
@@ -104,6 +105,13 @@ export const contentPageAccordion = z
})
.merge(accordionSchema)
export const contentPageLoyaltyTierComparison = z
.object({
__typename: z.literal(
ContentPageEnum.ContentStack.blocks.SasTierComparison
),
})
.merge(sasTierComparisonSchema)
export const contentPageHotelListing = z
.object({
__typename: z.literal(ContentPageEnum.ContentStack.blocks.HotelListing),
@@ -119,6 +127,7 @@ export const blocksSchema = z.discriminatedUnion("__typename", [
contentPageTable,
contentPageTextCols,
contentPageUspGrid,
contentPageLoyaltyTierComparison,
contentPageHotelListing,
])
@@ -3,6 +3,7 @@ import {
GetContentPage,
GetContentPageBlocksBatch1,
GetContentPageBlocksBatch2,
GetContentPageBlocksBatch3,
} from "@/lib/graphql/Query/ContentPage/ContentPage.graphql"
import { contentstackExtendedProcedureUID, router } from "@/server/trpc"
@@ -72,6 +73,17 @@ export const contentPageQueryRouter = router({
},
},
},
{
document: GetContentPageBlocksBatch3,
variables: { locale: lang, uid },
options: {
cache: "force-cache",
next: {
tags,
},
},
},
])
const contentPage = contentPageSchema.safeParse(contentPageRequest.data)