From 3f510e9aae0c48ccbda2c8f2dd40ba7530f08113 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Tue, 8 Apr 2025 12:33:06 +0000 Subject: [PATCH] fix: properties inside hotel_navigation could be null or undefined Approved-by: Michael Zetterberg --- .../routers/contentstack/hotelPage/output.ts | 18 +++++++++--------- .../components/hotelPage/tabNavigation.ts | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/scandic-web/server/routers/contentstack/hotelPage/output.ts b/apps/scandic-web/server/routers/contentstack/hotelPage/output.ts index a9e4d447e..740e3da00 100644 --- a/apps/scandic-web/server/routers/contentstack/hotelPage/output.ts +++ b/apps/scandic-web/server/routers/contentstack/hotelPage/output.ts @@ -40,16 +40,16 @@ export const hotelPageSchema = z.object({ .object({ hotel_navigation: z .object({ - overview: z.string().optional(), - rooms: z.string().optional(), - restaurant_bar: z.string().optional(), - conferences_meetings: z.string().optional(), - health_wellness: z.string().optional(), - activities: z.string().optional(), - offers: z.string().optional(), - faq: z.string().optional(), + overview: z.string().nullish(), + rooms: z.string().nullish(), + restaurant_bar: z.string().nullish(), + conferences_meetings: z.string().nullish(), + health_wellness: z.string().nullish(), + activities: z.string().nullish(), + offers: z.string().nullish(), + faq: z.string().nullish(), }) - .nullable(), + .nullish(), content: discriminatedUnionArray(contentBlock.options) .nullable() .transform((data) => { diff --git a/apps/scandic-web/types/components/hotelPage/tabNavigation.ts b/apps/scandic-web/types/components/hotelPage/tabNavigation.ts index 52d4ba006..de887691b 100644 --- a/apps/scandic-web/types/components/hotelPage/tabNavigation.ts +++ b/apps/scandic-web/types/components/hotelPage/tabNavigation.ts @@ -9,14 +9,14 @@ export enum HotelHashValues { } type Tabs = { - overview?: string - rooms?: string - restaurant_bar?: string - conferences_meetings?: string - health_wellness?: string - activities?: string - offers?: string - faq?: string + overview?: string | null + rooms?: string | null + restaurant_bar?: string | null + conferences_meetings?: string | null + health_wellness?: string | null + activities?: string | null + offers?: string | null + faq?: string | null } export type TabNavigationProps = {