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

@@ -3,15 +3,8 @@ import { z } from "zod"
import { BlocksEnums } from "../../../../types/blocksEnum"
import { ContentEnum } from "../../../../types/content"
import {
accountPageSchema,
collectionPageSchema,
contentPageSchema,
destinationCityPageSchema,
destinationCountryPageSchema,
destinationOverviewPageSchema,
hotelPageSchema,
loyaltyPageSchema,
startPageSchema,
linkRefsUnionSchema,
linkUnionSchema,
transformPageLink,
} from "../pageLinks"
import {
@@ -36,15 +29,7 @@ export const contentSchema = z.object({
.discriminatedUnion("__typename", [
imageContainerSchema,
sysAssetSchema,
accountPageSchema,
collectionPageSchema,
contentPageSchema,
destinationCityPageSchema,
destinationCountryPageSchema,
destinationOverviewPageSchema,
hotelPageSchema,
loyaltyPageSchema,
startPageSchema,
...linkUnionSchema.options,
])
.transform((data) => {
const link = transformPageLink(data)
@@ -73,15 +58,7 @@ export const contentRefsSchema = z.object({
node: z.discriminatedUnion("__typename", [
sysAssetRefsSchema,
imageContainerRefsSchema,
accountPageSchema,
collectionPageSchema,
contentPageSchema,
destinationCityPageSchema,
destinationCountryPageSchema,
destinationOverviewPageSchema,
hotelPageSchema,
loyaltyPageSchema,
startPageSchema,
...linkRefsUnionSchema.options,
]),
})
),