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 [];
|
||||
};
|
||||
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,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user