Handle the case of baseUrl not being set for a site, and remove the msd
config, replacing it with 'direct'.
Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -31,7 +31,7 @@ const baseQuery = fetchBaseQuery() | ... | @@ -31,7 +31,7 @@ const baseQuery = fetchBaseQuery() |
31 | const siteBaseQuery = async (args, api, options) => { | 31 | const siteBaseQuery = async (args, api, options) => { |
32 | const { site, url } = args | 32 | const { site, url } = args |
33 | const baseUrl = getSiteBaseUrl(site) | 33 | const baseUrl = getSiteBaseUrl(site) |
34 | return baseQuery({ ...args, url: `${baseUrl}/${url}` }, api, options) | 34 | return baseQuery({ ...args, url: `${baseUrl ? `${baseUrl}/` : ''}${url}` }, api, options) |
35 | } | 35 | } |
36 | 36 | ||
37 | export const sitePageSlice = createApi({ | 37 | export const sitePageSlice = createApi({ |
... | @@ -83,5 +83,5 @@ export const getSiteBaseUrl = (name: string): string => { | ... | @@ -83,5 +83,5 @@ export const getSiteBaseUrl = (name: string): string => { |
83 | return configSlice.selectors.getSiteBaseUrl(store.getState(), name) | 83 | return configSlice.selectors.getSiteBaseUrl(store.getState(), name) |
84 | } | 84 | } |
85 | 85 | ||
86 | setSiteConfig({ name: 'msd', baseUrl: 'https://myspecialtydoc-d1d234.webflow.io' }) | 86 | setSiteConfig({ name: 'direct' }) |
87 | 87 | ... | ... |
-
Please register or sign in to post a comment