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