Updates
This commit is contained in:
parent
40fbd295f5
commit
0a3f9c9df4
1 changed files with 21 additions and 12 deletions
|
|
@ -4,22 +4,31 @@ import { useMainStore } from '@/store';
|
||||||
export function fetchCmsContentForPage(issPage) {
|
export function fetchCmsContentForPage(issPage) {
|
||||||
const store = useMainStore()
|
const store = useMainStore()
|
||||||
const clientName = "ClientOverrideTest";//store.issConfig.clientName;
|
const clientName = "ClientOverrideTest";//store.issConfig.clientName;
|
||||||
const pageName = issPage + (clientName.length == 0 ? "" : "_" + clientName);
|
const clientOverride = (clientName.length == 0);
|
||||||
|
const pageName = issPage + (clientOverride ? "" : "_" + clientName.toLowerCase().replace(/ /g, ""));
|
||||||
|
|
||||||
return store.getPageData(issPage)
|
return store.getPageData(issPage)
|
||||||
.then(
|
.then(
|
||||||
// Get the base/default page first.
|
// Get the base/default page first.
|
||||||
(baseResponse) => {
|
(baseResponse) => {
|
||||||
return store.getPageData(pageName)
|
if ( !clientOverride ){
|
||||||
.then(
|
// Return the base page if there are no client override.
|
||||||
// Get the client override if it exists.
|
return processPageData(baseResponse, null);
|
||||||
(clientResponse) => {
|
}
|
||||||
return processPageData(baseResponse, clientResponse);
|
else {
|
||||||
},
|
// Else get the client override page.
|
||||||
(error) => {
|
return store.getPageData(pageName)
|
||||||
return processPageData(baseResponse, null);
|
.then(
|
||||||
}
|
(clientResponse) => {
|
||||||
);
|
// Process the client override if it exists.
|
||||||
|
return processPageData(baseResponse, clientResponse);
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
// Process the just the base if no client override exists.
|
||||||
|
return processPageData(baseResponse, null);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue