Skip to content

Commit

Permalink
Prevent model from containing null primary links (#17601)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunarVestmann authored and thoreyjona committed Jan 22, 2025
1 parent f367945 commit 7cbe038
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/cms/src/lib/models/organizationPage.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ export const mapOrganizationPage = ({
.map(safelyMapSliceUnion)
.filter(Boolean),
secondaryNewsTags: (fields.secondaryNewsTags ?? []).map(mapGenericTag),
menuLinks: (fields.menuLinks ?? []).map(mapLinkGroup),
menuLinks: (fields.menuLinks ?? [])
.map(mapLinkGroup)
.filter((linkGroup) => Boolean(linkGroup?.primaryLink)),
secondaryMenu: fields.secondaryMenu
? mapLinkGroup(fields.secondaryMenu)
: null,
Expand Down

0 comments on commit 7cbe038

Please sign in to comment.