refactor(labeling): moved bookin fails inside bookin as it could be off

This commit is contained in:
2025-08-27 17:17:03 -05:00
parent 2f908398bc
commit df423192bf

View File

@@ -277,26 +277,26 @@ export const labelingProcess = async ({
let book: any = [];
if (bookin[0].value === "1") {
book = await bookInLabel(label.data);
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,
};
}
} else {
createLog("info", "labeling", "ocp", "Bookin is turned off.");
// 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
const inhouseDelivery = settingData.filter(
(s) => s.name === "inhouseDelivery"