diff --git a/backend/datamart/datamart.controller.ts b/backend/datamart/datamart.controller.ts index 727ce61..066d85b 100644 --- a/backend/datamart/datamart.controller.ts +++ b/backend/datamart/datamart.controller.ts @@ -79,6 +79,7 @@ const lstDbRun = async (data: Data) => { return []; }; export const runDatamartQuery = async (data: Data) => { + console.log(data.options.includePlantToken); // search the query db for the query by name const considerLstDBRuns = ["psiInventory"]; @@ -326,8 +327,13 @@ export const runDatamartQuery = async (data: Data) => { level: "info", module: "datamart", subModule: "query", - message: `Data for: ${data.name}`, - data: queryRun.data, + message: `Data for: ${data.name} ${data.options.includePlantToken ? "including plant token" : ""}`, + // if includePlantToken was passed we should map this into the data + data: data.options.includePlantToken + ? queryRun.data.map((i) => { + return { plantToken: process.env.PROD_PLANT_TOKEN, ...i }; + }) + : queryRun.data, notify: false, }); };