refactor(histoircal data): cahnge to not look at yestrday
This commit is contained in:
@@ -26,7 +26,7 @@ export const historicalInvIMmport = async () => {
|
|||||||
}
|
}
|
||||||
// check if we have data already for today this way we dont duplicate anything.
|
// check if we have data already for today this way we dont duplicate anything.
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
today.setDate(today.getDate() - 1);
|
//today.setDate(today.getDate() - 1);
|
||||||
|
|
||||||
const dateCheck = data?.filter(
|
const dateCheck = data?.filter(
|
||||||
(i: any) => i.histDate === format(today, "yyyy-MM-dd")
|
(i: any) => i.histDate === format(today, "yyyy-MM-dd")
|
||||||
@@ -62,7 +62,8 @@ export const historicalInvIMmport = async () => {
|
|||||||
const importInv = inv.data ? inv.data : [];
|
const importInv = inv.data ? inv.data : [];
|
||||||
const eomImportData = importInv.map((i: any) => {
|
const eomImportData = importInv.map((i: any) => {
|
||||||
return {
|
return {
|
||||||
histDate: sql`(NOW() - INTERVAL '1 day')::date`,
|
//histDate: sql`(NOW() - INTERVAL '1 day')::date`,
|
||||||
|
histDate: sql`(NOW())::date`,
|
||||||
plantToken: plantToken[0].value,
|
plantToken: plantToken[0].value,
|
||||||
article: i.av,
|
article: i.av,
|
||||||
articleDescription: i.Alias,
|
articleDescription: i.Alias,
|
||||||
|
|||||||
Reference in New Issue
Block a user