fix(lots errors): fixes to prevent crashes when sql server not connected
This commit is contained in:
@@ -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.",
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user