fix(labeling): added in a catch to avoid rouge lots
This commit is contained in:
@@ -133,6 +133,14 @@ export const labelingProcess = async ({
|
||||
* The checks we do before we can actually print a label will take place meow.
|
||||
*
|
||||
*/
|
||||
// this will be for the rare case it actually doesn't find a lot properly or has some kinda error.
|
||||
if(!Array.isArray(filteredLot) || filteredLot.length === 0){
|
||||
createLog("error", "labeling", "ocp", `${printer?.name}, dose not apear to have a lot assigned to it.`);
|
||||
return {
|
||||
success: false,
|
||||
message: `${printer?.name}, dose not apear to have a lot assigned to it.`,
|
||||
};
|
||||
}
|
||||
|
||||
// if the plant does not want to have dual printing and we have >2 assigned well return and send error.
|
||||
let dualPrinting = settingData.filter((d) => d.name === "dualPrinting")[0]
|
||||
|
||||
Reference in New Issue
Block a user