fix(fakeedi updates): corrected an issue where multi orders would not update if 1 release was used
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user