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:
@@ -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=""
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"]
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user