fix(lots): if no sql it crashs due to lots returning a non error
This commit is contained in:
@@ -29,11 +29,11 @@ export const assignedPrinters = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const printers: any = print.data ?? [];
|
const printers: any = print.data ?? [];
|
||||||
const lots: any = l.data ?? [];
|
const lots: any = l.data.length === 0 ? [] : l.data;
|
||||||
|
|
||||||
for (let i = 0; i < printers.length; i++) {
|
for (let i = 0; i < printers.length; i++) {
|
||||||
// is the printer assinged in alplalabel online?
|
// is the printer assinged in alplalabel online?
|
||||||
const assigned = lots.filter(
|
const assigned = lots?.filter(
|
||||||
(p: any) => p.printerID === parseInt(printers[i].humanReadableId)
|
(p: any) => p.printerID === parseInt(printers[i].humanReadableId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user