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'`
);
let templateQueryToExecute,
useShopSpecificTemplate = false;
let templateQueryToExecute;
let useShopSpecificTemplate = false;
// let shopSpecificTemplate;
if (shopSpecificFolder) {
let shopSpecificTemplate = jsReportQueries.data.value.find(
(f) => f?.folder?.shortid === shopSpecificFolder.shortid
);
useShopSpecificTemplate = true;
templateQueryToExecute = atob(shopSpecificTemplate.content);
} else {
if (shopSpecificTemplate) {
useShopSpecificTemplate = true;
templateQueryToExecute = atob(shopSpecificTemplate.content);
}
}
if (!templateQueryToExecute) {
const generalTemplate = jsReportQueries.data.value.find((f) => !f.folder);
useShopSpecificTemplate = false;
templateQueryToExecute = atob(generalTemplate.content);