fix(SW-3084): Handle unpublished entries inside content pages
Approved-by: Matilda Landström
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -24,7 +24,12 @@ export const teaserCardsSchema = z.object({
|
||||
),
|
||||
}),
|
||||
})
|
||||
.nullish()
|
||||
.transform((data) => {
|
||||
if (!data?.teaser_cardConnection?.edges.length) {
|
||||
return null
|
||||
}
|
||||
|
||||
return {
|
||||
...transformTeaserCardBlock(data.teaser_cardConnection.edges[0].node),
|
||||
theme: data.theme,
|
||||
|
||||
Reference in New Issue
Block a user