JSR CHange

This commit is contained in:
Patrick Fic
2021-10-04 07:57:14 -07:00
parent 9f1d184081
commit 96f292f61c

View File

@@ -209,17 +209,21 @@ const fetchContextData = async (templateObject) => {
`${server}/odata/assets?$filter=name eq '${templateObject.name}.query'` `${server}/odata/assets?$filter=name eq '${templateObject.name}.query'`
); );
let templateQueryToExecute, let templateQueryToExecute;
useShopSpecificTemplate = false; let useShopSpecificTemplate = false;
// let shopSpecificTemplate; // let shopSpecificTemplate;
if (shopSpecificFolder) { if (shopSpecificFolder) {
let shopSpecificTemplate = jsReportQueries.data.value.find( let shopSpecificTemplate = jsReportQueries.data.value.find(
(f) => f?.folder?.shortid === shopSpecificFolder.shortid (f) => f?.folder?.shortid === shopSpecificFolder.shortid
); );
useShopSpecificTemplate = true; if (shopSpecificTemplate) {
templateQueryToExecute = atob(shopSpecificTemplate.content); useShopSpecificTemplate = true;
} else { templateQueryToExecute = atob(shopSpecificTemplate.content);
}
}
if (!templateQueryToExecute) {
const generalTemplate = jsReportQueries.data.value.find((f) => !f.folder); const generalTemplate = jsReportQueries.data.value.find((f) => !f.folder);
useShopSpecificTemplate = false; useShopSpecificTemplate = false;
templateQueryToExecute = atob(generalTemplate.content); templateQueryToExecute = atob(generalTemplate.content);