diff --git a/server/routers/contentstack/accountPage/output.ts b/server/routers/contentstack/accountPage/output.ts index 316c7d07a..a73757227 100644 --- a/server/routers/contentstack/accountPage/output.ts +++ b/server/routers/contentstack/accountPage/output.ts @@ -13,8 +13,8 @@ import { RTEDocument } from "@/types/rte/node" const accountPageShortcuts = z.object({ __typename: z.literal(ContentEntries.AccountPageContentShortcuts), shortcuts: z.object({ - title: z.string().optional(), - preamble: z.string().optional(), + title: z.string().nullable(), + preamble: z.string().nullable(), shortcuts: z.array( z.object({ linkConnection: z.object({ @@ -25,7 +25,7 @@ const accountPageShortcuts = z.object({ uid: z.string(), locale: z.nativeEnum(Lang), }), - original_url: z.string().optional(), + original_url: z.string().nullable().optional(), url: z.string(), title: z.string(), }), @@ -33,7 +33,7 @@ const accountPageShortcuts = z.object({ ), totalCount: z.number(), }), - text: z.string().optional(), + text: z.string().nullable(), open_in_new_tab: z.boolean(), }) ), @@ -43,8 +43,8 @@ const accountPageShortcuts = z.object({ const accountPageDynamicContent = z.object({ __typename: z.literal(ContentEntries.AccountPageContentDynamicContent), dynamic_content: z.object({ - title: z.string().optional(), - preamble: z.string().optional(), + title: z.string().nullable(), + preamble: z.string().nullable(), component: z.nativeEnum(DynamicContentComponents), link: z.object({ linkConnection: z.object({ @@ -56,7 +56,7 @@ const accountPageDynamicContent = z.object({ locale: z.nativeEnum(Lang), }), url: z.string(), - original_url: z.string().optional(), + original_url: z.string().nullable().optional(), title: z.string(), }), }) @@ -65,7 +65,6 @@ const accountPageDynamicContent = z.object({ }), link_text: z.string(), }), - // .optional(), }), }) diff --git a/server/routers/contentstack/accountPage/query.ts b/server/routers/contentstack/accountPage/query.ts index e37515843..56a0ac2d3 100644 --- a/server/routers/contentstack/accountPage/query.ts +++ b/server/routers/contentstack/accountPage/query.ts @@ -28,6 +28,8 @@ export const accountPageQueryRouter = router({ ) if (!validatedAccountPage.success) { + console.info(`Get Account Page Validation Error`) + console.error(validatedAccountPage.error) throw badRequestError() } // TODO: Make returned data nicer diff --git a/server/routers/contentstack/breadcrumbs/output.ts b/server/routers/contentstack/breadcrumbs/output.ts index 40b1bfa0f..a4c782bd5 100644 --- a/server/routers/contentstack/breadcrumbs/output.ts +++ b/server/routers/contentstack/breadcrumbs/output.ts @@ -1,6 +1,7 @@ -import { Lang } from "@/constants/languages" import { z } from "zod" +import { Lang } from "@/constants/languages" + export const validateBreadcrumbsRefsConstenstackSchema = z.object({ all_account_page: z.object({ items: z.array( diff --git a/types/components/myPages/myPage/accountPage.ts b/types/components/myPages/myPage/accountPage.ts index 59f55de2f..2bccbc69e 100644 --- a/types/components/myPages/myPage/accountPage.ts +++ b/types/components/myPages/myPage/accountPage.ts @@ -6,8 +6,8 @@ import { DynamicContentComponents } from "@/types/components/myPages/myPage/enum export type AccountPageContentProps = { component: DynamicContentComponents props: { - title?: string - subtitle?: string + title: string | null + subtitle: string | null link?: { href: string; text: string } lang: Lang } @@ -15,8 +15,8 @@ export type AccountPageContentProps = { export type AccountPageComponentProps = { lang: Lang - title?: string - subtitle?: string + title: string | null + subtitle: string | null link?: { href: string; text: string } } diff --git a/types/components/myPages/myPage/overview.ts b/types/components/myPages/myPage/overview.ts index bae28c8aa..4f8e13901 100644 --- a/types/components/myPages/myPage/overview.ts +++ b/types/components/myPages/myPage/overview.ts @@ -1,5 +1,5 @@ import type { User } from "@/types/user" export type OverviewProps = { - title?: string + title: string | null } diff --git a/types/components/myPages/stays/title.ts b/types/components/myPages/stays/title.ts index 33128cac0..20903e717 100644 --- a/types/components/myPages/stays/title.ts +++ b/types/components/myPages/stays/title.ts @@ -1,5 +1,5 @@ export type HeaderProps = { - title?: string - subtitle?: string + title: string | null + subtitle: string | null link?: { href: string; text: string } }