diff --git a/apps/storefront/src/app/[locale]/(main)/_components/hero-banner.tsx b/apps/storefront/src/app/[locale]/(main)/_components/hero-banner.tsx index 61f3f08..1a3adac 100644 --- a/apps/storefront/src/app/[locale]/(main)/_components/hero-banner.tsx +++ b/apps/storefront/src/app/[locale]/(main)/_components/hero-banner.tsx @@ -20,7 +20,7 @@ export const HeroBanner = async ({ const header = fieldsMap["homepage-banner-header"]?.text; const buttonText = fieldsMap["homepage-banner-button-text"]?.text; - const image = fieldsMap["homepage-banner-image-test"]?.imageUrl; + const image = fieldsMap["homepage-banner-image"]?.imageUrl; return (
diff --git a/apps/storefront/src/app/[locale]/(main)/_components/products-grid.tsx b/apps/storefront/src/app/[locale]/(main)/_components/products-grid.tsx index 1d75a0c..61995ae 100644 --- a/apps/storefront/src/app/[locale]/(main)/_components/products-grid.tsx +++ b/apps/storefront/src/app/[locale]/(main)/_components/products-grid.tsx @@ -41,7 +41,7 @@ export const ProductsGrid = async ({ const header = fieldsMap["homepage-grid-item-header"]?.text; const subheader = fieldsMap["homepage-grid-item-subheader"]?.text; - const image = fieldsMap["homepage-grid-item-image-test"]?.imageUrl; + const image = fieldsMap["homepage-grid-item-image"]?.imageUrl; const buttonText = fieldsMap["homepage-button-text"]?.text; const headerFontColor = fieldsMap["homepage-grid-item-header-font-color"]?.text; diff --git a/packages/infrastructure/src/public/butter-cms/cms-menu/infrastructure/cms-menu-get-infra.ts b/packages/infrastructure/src/public/butter-cms/cms-menu/infrastructure/cms-menu-get-infra.ts index d0437aa..a65cefb 100644 --- a/packages/infrastructure/src/public/butter-cms/cms-menu/infrastructure/cms-menu-get-infra.ts +++ b/packages/infrastructure/src/public/butter-cms/cms-menu/infrastructure/cms-menu-get-infra.ts @@ -11,13 +11,21 @@ import type { ButterCMSMenuServiceConfig } from "../types"; export const butterCMSMenuGetInfra = ({ token }: ButterCMSMenuServiceConfig): CMSMenuGetInfra => async ({ languageCode, slug }) => { - const locale = languageCode ? convertLanguageCode(languageCode) : undefined; - - // @ts-expect-error due to deep type inference issues with ButterCMS types - const menu = await Butter(token).content.retrieve( - ["navigation_menu"], - locale ? { locale } : undefined, - ); + const locale = convertLanguageCode(languageCode); + let menu; + + try { + // @ts-expect-error due to deep type inference issues with ButterCMS types + menu = await Butter(token).content.retrieve( + ["navigation_menu"], + locale ? { locale } : undefined, + ); + } catch (error) { + // Fallback to 'EN_US' if the initial request fails + menu = await Butter(token).content.retrieve(["navigation_menu"], { + locale: "enus", + }); + } if (!menu?.data?.data?.navigation_menu) { return null; diff --git a/packages/infrastructure/src/public/butter-cms/cms-page/infrastructure/cms-page-get-infra.ts b/packages/infrastructure/src/public/butter-cms/cms-page/infrastructure/cms-page-get-infra.ts index 580b3d2..d487af7 100644 --- a/packages/infrastructure/src/public/butter-cms/cms-page/infrastructure/cms-page-get-infra.ts +++ b/packages/infrastructure/src/public/butter-cms/cms-page/infrastructure/cms-page-get-infra.ts @@ -27,9 +27,18 @@ export const butterCMSPageGetInfra = async ({ pageType, slug, languageCode }) => { const resolvedPageType = pageType ?? PageType.STATIC_PAGE; const locale = convertLanguageCode(languageCode); - const page = await Butter(token).page.retrieve(resolvedPageType, slug, { - locale, - } as PageRetrieveParams); + let page; + + try { + page = await Butter(token).page.retrieve(resolvedPageType, slug, { + locale, + } as PageRetrieveParams); + } catch (error) { + // Fallback to 'EN_US' if the initial request fails + page = await Butter(token).page.retrieve(resolvedPageType, slug, { + locale: "enus", + } as PageRetrieveParams); + } if (!page?.data?.data) { return null;