fix(fakeedi updates): corrected an issue where multi orders would not update if 1 release was used

This commit is contained in:
2025-04-30 12:14:26 -05:00
parent 156cd845e0
commit 7ed1c32ae9
5 changed files with 24 additions and 7 deletions

View File

@@ -1,3 +1,4 @@
import { format } from "date-fns-tz";
import { createLog } from "../../logger/logger.js";
import { query } from "../../sqlServer/prodSqlServer.js";
import { fakeEDIUpdate } from "../../sqlServer/querys/dataMart/fakeEDIUpdate.js";
@@ -23,10 +24,17 @@ export const getFakeEDI = async (address: string) => {
try {
fakeEDI = await query(updatedQuery, "Gets fakeEDI orders to be fixed");
const correctedData = fakeEDI.data.map((n: any) => {
return {
...n,
DeliveryDate: format(n.DeliveryDate, "M/d/yyyy HH:mm"),
};
});
return {
success: true,
message: "Current open orders",
data: fakeEDI.data,
data: correctedData,
};
} catch (error) {
console.log(error);