refactor(datamart): if added to query will include plant token now
This commit is contained in:
@@ -79,6 +79,7 @@ const lstDbRun = async (data: Data) => {
|
|||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
export const runDatamartQuery = async (data: Data) => {
|
export const runDatamartQuery = async (data: Data) => {
|
||||||
|
console.log(data.options.includePlantToken);
|
||||||
// search the query db for the query by name
|
// search the query db for the query by name
|
||||||
const considerLstDBRuns = ["psiInventory"];
|
const considerLstDBRuns = ["psiInventory"];
|
||||||
|
|
||||||
@@ -326,8 +327,13 @@ export const runDatamartQuery = async (data: Data) => {
|
|||||||
level: "info",
|
level: "info",
|
||||||
module: "datamart",
|
module: "datamart",
|
||||||
subModule: "query",
|
subModule: "query",
|
||||||
message: `Data for: ${data.name}`,
|
message: `Data for: ${data.name} ${data.options.includePlantToken ? "including plant token" : ""}`,
|
||||||
data: queryRun.data,
|
// 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,
|
notify: false,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user