fix(bookin): corrected the error received from the book in fail
This commit is contained in:
@@ -96,7 +96,7 @@ export const bookInLabel = async (data: any) => {
|
|||||||
"ocp",
|
"ocp",
|
||||||
`${
|
`${
|
||||||
data.printer ? data.printer[0].name : "Manual book in"
|
data.printer ? data.printer[0].name : "Manual book in"
|
||||||
}, "Error: ${error}`
|
}, "Error: ${error?.response.data}`
|
||||||
);
|
);
|
||||||
// console.log(error.response.data);
|
// console.log(error.response.data);
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { bookInLabel } from "./bookIn.js";
|
|||||||
import { delieryInhouse } from "../specialProcesses/inhouse/inhouseDelivery.js";
|
import { delieryInhouse } from "../specialProcesses/inhouse/inhouseDelivery.js";
|
||||||
import { dualPrintingProcess } from "../specialProcesses/dualPrinting/dualPrinting.js";
|
import { dualPrintingProcess } from "../specialProcesses/dualPrinting/dualPrinting.js";
|
||||||
import { getMac } from "../../utils/getMachineId.js";
|
import { getMac } from "../../utils/getMachineId.js";
|
||||||
|
import { success } from "zod/v4";
|
||||||
|
|
||||||
interface Printer {
|
interface Printer {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -283,6 +284,20 @@ export const labelingProcess = async ({
|
|||||||
// will add later!!! :P
|
// will add later!!! :P
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!book.success) {
|
||||||
|
// createLog(
|
||||||
|
// "error",
|
||||||
|
// "labeling",
|
||||||
|
// "ocp",
|
||||||
|
// `Error Booking in label: ${book.errors[0].message}`
|
||||||
|
// );
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
message: `Error Booking in label: ${book.errors[0].message}`,
|
||||||
|
data: book,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// inhouse - if the inhouse funtion is turned on we will deliver to inhouse as long as we did not hit an error state
|
// inhouse - if the inhouse funtion is turned on we will deliver to inhouse as long as we did not hit an error state
|
||||||
const inhouseDelivery = settingData.filter(
|
const inhouseDelivery = settingData.filter(
|
||||||
(s) => s.name === "inhouseDelivery"
|
(s) => s.name === "inhouseDelivery"
|
||||||
|
|||||||
Reference in New Issue
Block a user