fix(SW-3305): Added preamble to carousel cards block

Approved-by: Matilda Landström
Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
Erik Tiekstra
2025-08-28 07:22:07 +00:00
parent 56db65d49a
commit 1a10afdbad
3 changed files with 6 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ fragment CarouselCards_StartPageRefs on StartPageBlocksCarouselCards {
fragment CarouselCards_CampaignPage on CampaignPageBlocksCarouselCards {
carousel_cards {
heading
preamble
enable_filters
card_groups {
filter_label

View File

@@ -11,6 +11,7 @@ import { linkConnectionRefsSchema } from "./utils/linkConnection"
const commonFields = {
heading: z.string().optional(),
preamble: z.string().nullish(),
link: buttonSchema.nullish(),
} as const
@@ -103,6 +104,7 @@ export const carouselCardsSchema = z.object({
if (!data.enable_filters) {
return {
heading: data.heading,
preamble: data.preamble,
enableFilters: false,
filterCategories: [],
cards: data.card_groups.map((group) => group.cards).flat(),
@@ -121,6 +123,7 @@ export const carouselCardsSchema = z.object({
return {
heading: data.heading,
preamble: data.preamble,
enableFilters: true,
filterCategories,
cards: data.card_groups.map((group) => group.cards).flat(),