Added third party payer support IO-546
This commit is contained in:
@@ -44,11 +44,15 @@ export default async function RenderTemplate(
|
||||
"There are too many queries to choose from. Please ensure there are no conflicting keys."
|
||||
);
|
||||
}
|
||||
const { data: contextData } = await client.query({
|
||||
query: gql(templateQueryToExecute),
|
||||
variables: { ...templateObject.variables },
|
||||
fetchPolicy: "network-only",
|
||||
});
|
||||
let contextData;
|
||||
if (templateQueryToExecute) {
|
||||
const { data } = await client.query({
|
||||
query: gql(templateQueryToExecute),
|
||||
variables: { ...templateObject.variables },
|
||||
fetchPolicy: "network-only",
|
||||
});
|
||||
contextData = data;
|
||||
}
|
||||
|
||||
let reportRequest = {
|
||||
template: {
|
||||
@@ -58,8 +62,9 @@ export default async function RenderTemplate(
|
||||
...(renderAsHtml ? {} : { recipe: "chrome-pdf" }),
|
||||
},
|
||||
data: {
|
||||
...contextData,
|
||||
...(templateQueryToExecute ? contextData : {}),
|
||||
...templateObject.variables,
|
||||
...templateObject.context,
|
||||
headerpath: `/${bodyshop.imexshopid}/header.html`,
|
||||
bodyshop: bodyshop,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user