fix(SW-3084): Handle unpublished entries inside content pages

Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-08-14 07:24:35 +00:00
parent 04aebb372c
commit a362d236fb
5 changed files with 26 additions and 27 deletions

View File

@@ -25,7 +25,12 @@ export const scriptedCardsSchema = z.object({
),
}),
})
.nullish()
.transform((data) => {
if (!data?.scripted_cardConnection?.edges.length) {
return null
}
return {
theme: data.theme,
...transformCardBlock(data.scripted_cardConnection.edges[0].node),