From 3d89c697a6e790bac5b9c36e8052057042143fa5 Mon Sep 17 00:00:00 2001 From: Adam Raya Navarro Date: Tue, 13 Sep 2022 16:54:57 -0700 Subject: [PATCH 1/2] Rename `siteAliasOrIdRef` to `site` --- packages/template-retail-react-app/app/utils/url.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/template-retail-react-app/app/utils/url.js b/packages/template-retail-react-app/app/utils/url.js index dd485a5034..65a3cdd7d6 100644 --- a/packages/template-retail-react-app/app/utils/url.js +++ b/packages/template-retail-react-app/app/utils/url.js @@ -158,9 +158,9 @@ export const getPathWithLocale = (shortCode, buildUrl, opts = {}) => { }) } - const siteAliasOrIdRef = getSiteByReference(siteRef) + const site = getSiteByReference(siteRef) - const locale = getLocaleByReference(siteAliasOrIdRef, shortCode) + const locale = getLocaleByReference(site, shortCode) // rebuild the url with new locale, const newUrl = buildUrl( @@ -185,10 +185,10 @@ export const getPathWithLocale = (shortCode, buildUrl, opts = {}) => { export const createUrlTemplate = (appConfig, siteRef, localeRef) => { const {site: siteConfig, locale: localeConfig, showDefaults: showDefaultsConfig} = appConfig.url const defaultSite = getDefaultSite() - const siteAliasOrIdRef = getSiteByReference(siteRef) + const site = getSiteByReference(siteRef) const defaultLocale = getLocaleByReference( - siteAliasOrIdRef, - siteAliasOrIdRef.l10n.defaultLocale + site, + site.l10n.defaultLocale ) const isDefaultSite = From 864e9c775957efd89184943444645e9bfdc1d3d3 Mon Sep 17 00:00:00 2001 From: Adam Raya Navarro Date: Tue, 13 Sep 2022 17:08:30 -0700 Subject: [PATCH 2/2] lint --- packages/template-retail-react-app/app/utils/url.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/template-retail-react-app/app/utils/url.js b/packages/template-retail-react-app/app/utils/url.js index 65a3cdd7d6..a35b3272bf 100644 --- a/packages/template-retail-react-app/app/utils/url.js +++ b/packages/template-retail-react-app/app/utils/url.js @@ -186,10 +186,7 @@ export const createUrlTemplate = (appConfig, siteRef, localeRef) => { const {site: siteConfig, locale: localeConfig, showDefaults: showDefaultsConfig} = appConfig.url const defaultSite = getDefaultSite() const site = getSiteByReference(siteRef) - const defaultLocale = getLocaleByReference( - site, - site.l10n.defaultLocale - ) + const defaultLocale = getLocaleByReference(site, site.l10n.defaultLocale) const isDefaultSite = defaultSite.id === siteRef || (defaultSite.alias && defaultSite.alias === siteRef)