From 164061200db290a0b0f9f5f52f7cf62a3a8a8316 Mon Sep 17 00:00:00 2001 From: Dylan Kelly Date: Wed, 23 Oct 2024 11:51:59 +1100 Subject: [PATCH] fix(@dpc-sdp/nuxt-ripple): :bug: handle missing menus better --- .../sidebar-site-section-nav-mapping.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nuxt-ripple/mapping/base/sidebar-site-section-nav/sidebar-site-section-nav-mapping.ts b/packages/nuxt-ripple/mapping/base/sidebar-site-section-nav/sidebar-site-section-nav-mapping.ts index 919530dca1..ab6a4f0576 100644 --- a/packages/nuxt-ripple/mapping/base/sidebar-site-section-nav/sidebar-site-section-nav-mapping.ts +++ b/packages/nuxt-ripple/mapping/base/sidebar-site-section-nav/sidebar-site-section-nav-mapping.ts @@ -14,7 +14,10 @@ export const map = async (src, tidePageApi: TidePageApi) => { // Finally, this site data will contain a reference to the menu we need to fetch const menuData = siteData.field_site_main_menu - + // if a menu is deleted Drupal returns an id of 'missing' + if (menuData?.id === 'missing') { + return null + } const menu = await tidePageApi.getSiteMenu( tidePageApi.site, menuData,