Merged in fix/handle-unpublished-profiling-consent (pull request #3275)

fix: handle unpublished profiling consent

* fix: handle unpublished profiling consent


Approved-by: Emma Zettervall
Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
Matilda Landström
2025-12-03 08:41:33 +00:00
parent 22d00bb363
commit f19d5fa083
4 changed files with 13 additions and 8 deletions

View File

@@ -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,

View File

@@ -2,12 +2,17 @@ import type { z } from "zod"
import type { profilingConsentSchema } from "../routers/contentstack/profilingConsent/output"
export interface GetProfilingConsentData
extends z.input<typeof profilingConsentSchema> {}
export interface GetProfilingConsentData extends z.input<
typeof profilingConsentSchema
> {}
export interface ProfilingConsent
extends z.output<typeof profilingConsentSchema> {}
export type ProfilingConsent = z.output<typeof profilingConsentSchema>
export type ProfilingConsentNonNull = NonNullable<ProfilingConsent>
export type ProfilingConsentBanner = NonNullable<ProfilingConsent["banner"]>
export type ProfilingConsentBanner = NonNullable<
ProfilingConsentNonNull["banner"]
>
export type ProfilingConsentModal = NonNullable<ProfilingConsent["modal"]>
export type ProfilingConsentModal = NonNullable<
ProfilingConsentNonNull["modal"]
>