Merged in fix/nullable-dynamic-content-in-static-page-header (pull request #2058)

fix: update header  dynamic_content schema to allow null values

* fix: update header  dynamic_content schema to allow null values

* fix: update to use nullish


Approved-by: Erik Tiekstra
This commit is contained in:
Chuma Mcphoy (We Ahead)
2025-05-12 12:57:40 +00:00
parent bbc279379f
commit 8530c2cc93
2 changed files with 5 additions and 3 deletions

View File

@@ -53,7 +53,9 @@ export default async function StaticPage({
{header.navigation_links ? (
<LinkChips chips={header.navigation_links} />
) : null}
{"dynamic_content" in header && header.dynamic_content ? (
{"dynamic_content" in header &&
header.dynamic_content !== null &&
header.dynamic_content !== undefined ? (
<HeaderDynamicContent {...header.dynamic_content} />
) : null}
</>

View File

@@ -214,7 +214,7 @@ export const contentPageSchema = z.object({
preamble: z.string(),
top_primary_button: topPrimaryButtonSchema,
navigation_links: navigationLinksSchema,
dynamic_content: headerDynamicContentSchema.optional(),
dynamic_content: headerDynamicContentSchema.nullish(),
}),
meeting_package: z
.object({
@@ -330,7 +330,7 @@ const contentPageSidebarRefsItem = z.discriminatedUnion("__typename", [
const contentPageHeaderRefs = z.object({
navigation_links: z.array(linkConnectionRefs),
top_primary_button: linkConnectionRefs.nullable(),
dynamic_content: headerDynamicContentRefsSchema.optional(),
dynamic_content: headerDynamicContentRefsSchema.nullish(),
})
export const contentPageRefsSchema = z.object({