fix(lots errors): fixes to prevent crashes when sql server not connected

This commit is contained in:
2025-04-17 18:40:35 -05:00
parent e7e35336f8
commit d5114ba243
5 changed files with 201 additions and 195 deletions

View File

@@ -11,18 +11,10 @@ export const getLots = async () => {
return {
success: false,
message: "There was an error getting the lots",
data: lotError,
data: [],
};
}
// if (!lotInfo.data.success) {
// return {
// success: false,
// message: "There was an error getting the lots",
// data: lotInfo.data.message,
// };
// }
return {
success: true,
message: "Current active lots that are technically released.",

View File

@@ -25,7 +25,7 @@ export const updatePrinters = async () => {
})
);
if (prodError) {
if (prodError || prodPrinters?.data.length > 10000) {
//console.log(prodError);
return {
success: false,
@@ -35,7 +35,7 @@ export const updatePrinters = async () => {
}
// do the printer update into our db
const prodPrinterInfo = prodPrinters.data;
const prodPrinterInfo = prodPrinters?.data;
for (let i = 0; i < prodPrinterInfo.length; i++) {
const printerStuff: any = {