Added third party payer support IO-546

This commit is contained in:
Patrick Fic
2021-02-10 14:07:08 -08:00
parent 563d3a189a
commit 9e2c17670f
12 changed files with 599 additions and 15 deletions

View File

@@ -15,7 +15,6 @@ export const axiosAuthInterceptorId = axios.interceptors.request.use(
config.headers.Authorization = `Bearer ${token}`;
}
}
console.log("Axios interceptor called.");
return config;
},
(error) => Promise.reject(error)

View File

@@ -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,
},

View File

@@ -77,6 +77,16 @@ export const TemplateList = (type, context) => {
},
}
: {}),
...(!type || type === "job_special"
? {
thirdpartypayer: {
title: i18n.t("printcenter.jobs.thirdpartypayer"),
description: "CSI invite",
key: "special/thirdpartypayer",
disabled: false,
},
}
: {}),
...(!type || type === "appointment"
? {
appointment_confirmation: {