diff --git a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/index.tsx
index 782264645..b72ebfd23 100644
--- a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/index.tsx
+++ b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/index.tsx
@@ -51,7 +51,9 @@ export default async function DestinationCityPage() {
-
+ {images?.length && (
+
+ )}
@@ -61,7 +63,7 @@ export default async function DestinationCityPage() {
{preamble}
- {has_sidepeek && (
+ {has_sidepeek && sidepeek_content && (
-
+ {images?.length && (
+
+ )}
@@ -65,7 +70,7 @@ export default async function DestinationCountryPage() {
{preamble}
- {has_sidepeek && (
+ {has_sidepeek && sidepeek_content && (
- {buttonText}
+ {buttonText || intl.formatMessage({ id: "Read more" })}
destination_experiences),
+ .nullish()
+ .transform((experiences) => experiences?.destination_experiences ?? []),
images: z
.array(z.object({ image: tempImageVaultAssetSchema }))
.transform((images) =>
images
.map((image) => image.image)
.filter((image): image is ImageVaultAsset => !!image)
- ),
+ )
+ .nullish(),
has_sidepeek: z.boolean().default(false),
- sidepeek_button_text: z.string().default(""),
- sidepeek_content: z.object({
- heading: z.string(),
- content: z.object({
- json: z.any(),
- embedded_itemsConnection: z.object({
- edges: z.array(
- z.object({
- node: linkUnionSchema.transform((data) => {
- const link = transformPageLink(data)
- if (link) {
- return link
- }
- return data
- }),
- })
- ),
+ sidepeek_button_text: z.string().nullish().default(""),
+ sidepeek_content: z
+ .object({
+ heading: z.string(),
+ content: z.object({
+ json: z.any(),
+ embedded_itemsConnection: z.object({
+ edges: z.array(
+ z.object({
+ node: linkUnionSchema.transform((data) => {
+ const link = transformPageLink(data)
+ if (link) {
+ return link
+ }
+ return data
+ }),
+ })
+ ),
+ }),
}),
- }),
- }),
+ })
+ .nullish(),
blocks: discriminatedUnionArray(blocksSchema.options).nullable(),
system: systemSchema.merge(
z.object({
@@ -228,17 +232,19 @@ const blocksRefsSchema = z.discriminatedUnion("__typename", [
export const destinationCityPageRefsSchema = z.object({
destination_city_page: z.object({
- sidepeek_content: z.object({
- content: z.object({
- embedded_itemsConnection: z.object({
- edges: z.array(
- z.object({
- node: linkRefsUnionSchema,
- })
- ),
+ sidepeek_content: z
+ .object({
+ content: z.object({
+ embedded_itemsConnection: z.object({
+ edges: z.array(
+ z.object({
+ node: linkRefsUnionSchema,
+ })
+ ),
+ }),
}),
- }),
- }),
+ })
+ .nullish(),
blocks: discriminatedUnionArray(blocksRefsSchema.options).nullable(),
system: systemSchema,
}),
diff --git a/apps/scandic-web/server/routers/contentstack/destinationCountryPage/output.ts b/apps/scandic-web/server/routers/contentstack/destinationCountryPage/output.ts
index 553f8f4a6..551b0450b 100644
--- a/apps/scandic-web/server/routers/contentstack/destinationCountryPage/output.ts
+++ b/apps/scandic-web/server/routers/contentstack/destinationCountryPage/output.ts
@@ -63,28 +63,31 @@ export const destinationCountryPageSchema = z.object({
images
.map((image) => image.image)
.filter((image): image is ImageVaultAsset => !!image)
- ),
+ )
+ .nullish(),
has_sidepeek: z.boolean().default(false),
- sidepeek_button_text: z.string().default(""),
- sidepeek_content: z.object({
- heading: z.string(),
- content: z.object({
- json: z.any(),
- embedded_itemsConnection: z.object({
- edges: z.array(
- z.object({
- node: linkUnionSchema.transform((data) => {
- const link = transformPageLink(data)
- if (link) {
- return link
- }
- return data
- }),
- })
- ),
+ sidepeek_button_text: z.string().nullish(),
+ sidepeek_content: z
+ .object({
+ heading: z.string(),
+ content: z.object({
+ json: z.any(),
+ embedded_itemsConnection: z.object({
+ edges: z.array(
+ z.object({
+ node: linkUnionSchema.transform((data) => {
+ const link = transformPageLink(data)
+ if (link) {
+ return link
+ }
+ return data
+ }),
+ })
+ ),
+ }),
}),
- }),
- }),
+ })
+ .nullish(),
blocks: discriminatedUnionArray(blocksSchema.options).nullable(),
system: systemSchema.merge(
z.object({