Merged in feat/rework-contentstack (pull request #3493)

Feat(SW-3708): refactor contentstack fetching (removing all refs) and cache invalidation

* Remove all REFS

* Revalidate correct language

* PR fixes

* PR fixes

* Throw when errors from contentstack api


Approved-by: Joakim Jäderberg
This commit is contained in:
Linus Flood
2026-01-27 12:38:36 +00:00
parent a5e214f783
commit 5fc93472f4
193 changed files with 489 additions and 9018 deletions

View File

@@ -2,11 +2,9 @@ import { z } from "zod"
import { SidebarEnums } from "../../../../types/sidebar"
import {
teaserCardBlockRefsSchema,
teaserCardBlockSchema,
transformTeaserCardBlock,
} from "../blocks/cards/teaserCard"
import { transformCardBlockRefs } from "../blocks/cardsGrid"
export const teaserCardsSchema = z.object({
typename: z
@@ -36,23 +34,3 @@ export const teaserCardsSchema = z.object({
}
}),
})
export const teaserCardRefschema = z.object({
teaser_card: z
.object({
teaser_cardConnection: z.object({
edges: z.array(
z.object({
node: teaserCardBlockRefsSchema,
})
),
}),
})
.transform((data) => {
let card = null
if (data.teaser_cardConnection.edges.length) {
card = transformCardBlockRefs(data.teaser_cardConnection.edges[0].node)
}
return card
}),
})