diff --git a/apps/scandic-web/.env.local.example b/apps/scandic-web/.env.local.example index 981bcdb1c..69e92563e 100644 --- a/apps/scandic-web/.env.local.example +++ b/apps/scandic-web/.env.local.example @@ -39,7 +39,6 @@ GOOGLE_STATIC_MAP_ID="" GOOGLE_DYNAMIC_MAP_ID="" ENABLE_SURPRISES="true" -ENABLE_DTMC="true" SAS_POINT_TRANSFER_ENABLED="true" SAS_API_ENDPOINT="" diff --git a/apps/scandic-web/components/MyPages/ProfilingConsent/Banner/index.tsx b/apps/scandic-web/components/MyPages/ProfilingConsent/Banner/index.tsx index dc2c729e4..f6ffd1399 100644 --- a/apps/scandic-web/components/MyPages/ProfilingConsent/Banner/index.tsx +++ b/apps/scandic-web/components/MyPages/ProfilingConsent/Banner/index.tsx @@ -12,7 +12,7 @@ export async function ProfilingConsentBanner() { if (!user || userHasConsent(user?.profilingConsent)) return null const data = await getProfilingConsent() - if (!data) return null + if (!data?.profiling_consent) return null const { icon, banner } = data.profiling_consent diff --git a/packages/trpc/lib/routers/contentstack/profilingConsent/output.ts b/packages/trpc/lib/routers/contentstack/profilingConsent/output.ts index 0df9d30d6..14c850d66 100644 --- a/packages/trpc/lib/routers/contentstack/profilingConsent/output.ts +++ b/packages/trpc/lib/routers/contentstack/profilingConsent/output.ts @@ -40,6 +40,7 @@ export const profilingConsentSchema = z }) .transform((data) => { const profiling_consent = data.all_profiling_consent.items[0] + if (!profiling_consent) return null return { icon: profiling_consent.main_icon, banner: profiling_consent.profiling_consent_banner, diff --git a/packages/trpc/lib/types/profilingConsent.ts b/packages/trpc/lib/types/profilingConsent.ts index 8cfdf9ba9..57fc872d0 100644 --- a/packages/trpc/lib/types/profilingConsent.ts +++ b/packages/trpc/lib/types/profilingConsent.ts @@ -2,12 +2,17 @@ import type { z } from "zod" import type { profilingConsentSchema } from "../routers/contentstack/profilingConsent/output" -export interface GetProfilingConsentData - extends z.input {} +export interface GetProfilingConsentData extends z.input< + typeof profilingConsentSchema +> {} -export interface ProfilingConsent - extends z.output {} +export type ProfilingConsent = z.output +export type ProfilingConsentNonNull = NonNullable -export type ProfilingConsentBanner = NonNullable +export type ProfilingConsentBanner = NonNullable< + ProfilingConsentNonNull["banner"] +> -export type ProfilingConsentModal = NonNullable +export type ProfilingConsentModal = NonNullable< + ProfilingConsentNonNull["modal"] +>