fix(dockdoorscanner): corrections to how things get posted so it makes more sense

This commit is contained in:
2026-06-14 03:53:34 -05:00
parent 39db142db4
commit 22a7b612e1

View File

@@ -27,6 +27,7 @@ const postScan = async (data: any) => {
loadingUnit: data.loadingUnit.sscc ?? data.loadingUnit.runningNo, // can be running number or sscc depending on where it came from loadingUnit: data.loadingUnit.sscc ?? data.loadingUnit.runningNo, // can be running number or sscc depending on where it came from
loadingUnitStatus: data.loadingUnitStatus, // TODO: add enums on the status of each load. loadingUnitStatus: data.loadingUnitStatus, // TODO: add enums on the status of each load.
message: data.message, // the response it gave when scanning message: data.message, // the response it gave when scanning
status: data.status ?? undefined,
}) })
.returning()) as any; .returning()) as any;
@@ -76,6 +77,7 @@ const loadUnit = async (data: Data) => {
loadingUnitStatus: "notLoaded", loadingUnitStatus: "notLoaded",
message: message:
"There are know current active loading orders please start one and try again.", "There are know current active loading orders please start one and try again.",
status: "error",
}); });
return returnFunc({ return returnFunc({
success: true, success: true,
@@ -86,7 +88,6 @@ const loadUnit = async (data: Data) => {
"There are know current active loading orders please start one and try again.", "There are know current active loading orders please start one and try again.",
data: [], data: [],
notify: false, notify: false,
room: `dockDoorLoading:${data.dockId}`,
}); });
} }
// check if its a valids an sscc // check if its a valids an sscc
@@ -99,6 +100,7 @@ const loadUnit = async (data: Data) => {
loadingUnitStatus: "noread", loadingUnitStatus: "noread",
message: message:
"Failed to load the unit to the truck, there was no pallet read.", "Failed to load the unit to the truck, there was no pallet read.",
status: "error",
}); });
return returnFunc({ return returnFunc({
@@ -110,7 +112,6 @@ const loadUnit = async (data: Data) => {
"Failed to load the unit to the truck, there was no pallet read.", "Failed to load the unit to the truck, there was no pallet read.",
data: [], data: [],
notify: false, notify: false,
room: `dockDoorLoading:${data.dockId}`,
}); });
} }
@@ -137,6 +138,7 @@ const loadUnit = async (data: Data) => {
loadingUnit: unitToScan, loadingUnit: unitToScan,
loadingUnitStatus: "notLoaded", loadingUnitStatus: "notLoaded",
message: prod?.data.errors[0].message, message: prod?.data.errors[0].message,
status: "error",
}); });
return returnFunc({ return returnFunc({