From 056cab2991ee9a76b97c1e89bd9b4d4fa7aa5115 Mon Sep 17 00:00:00 2001 From: Patryk Tomczyk <13100280+patzick@users.noreply.github.com> Date: Wed, 29 Jul 2020 15:53:06 +0200 Subject: [PATCH] fix(default-theme): catch api client rejection during fetching the footer navigation (#979) Co-authored-by: mkucmus --- .../organisms/SwFooterNavigation.vue | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/packages/default-theme/components/organisms/SwFooterNavigation.vue b/packages/default-theme/components/organisms/SwFooterNavigation.vue index 8b6de0389..2ec4a9144 100644 --- a/packages/default-theme/components/organisms/SwFooterNavigation.vue +++ b/packages/default-theme/components/organisms/SwFooterNavigation.vue @@ -52,27 +52,37 @@ export default { const column = ref(4) onMounted(async () => { - const navigationResponse = await getStoreNavigation( - { - requestActiveId: "footer-navigation", - requestRootId: "footer-navigation", - searchCriteria: { - configuration: { - includes: { - category: ["seoUrls", "externalLink", "name", "id", "children"], - seo_url: ["pathInfo", "seoPathInfo"], - }, - associations: [ - { - name: "seoUrls", + try { + const navigationResponse = await getStoreNavigation( + { + requestActiveId: "footer-navigation", + requestRootId: "footer-navigation", + searchCriteria: { + configuration: { + includes: { + category: [ + "seoUrls", + "externalLink", + "name", + "id", + "children", + ], + seo_url: ["pathInfo", "seoPathInfo"], }, - ], + associations: [ + { + name: "seoUrls", + }, + ], + }, }, }, - }, - apiInstance - ) - navigationLinks.value = getStoreNavigationRoutes(navigationResponse) + apiInstance + ) + navigationLinks.value = getStoreNavigationRoutes(navigationResponse) + } catch (e) { + console.error("SwFooterNavigation:setup:onMounted", e) + } }) const open = computed(() => {