Skip to content

Commit

Permalink
Rename siteAliasOrIdRef to site (#717)
Browse files Browse the repository at this point in the history
* Rename `siteAliasOrIdRef` to `site`

* lint
  • Loading branch information
adamraya authored Sep 14, 2022
1 parent 2420bf2 commit 5f69588
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/template-retail-react-app/app/utils/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -185,11 +185,8 @@ 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 defaultLocale = getLocaleByReference(
siteAliasOrIdRef,
siteAliasOrIdRef.l10n.defaultLocale
)
const site = getSiteByReference(siteRef)
const defaultLocale = getLocaleByReference(site, site.l10n.defaultLocale)

const isDefaultSite =
defaultSite.id === siteRef || (defaultSite.alias && defaultSite.alias === siteRef)
Expand Down

0 comments on commit 5f69588

Please sign in to comment.