refactor(sql): improved the return function to show data [] when not connected, prevents crashes
This commit is contained in:
@@ -19,7 +19,8 @@ export const consumeMaterial = async (data: Data, prod: any) => {
|
||||
let barcode;
|
||||
// get the barcode from the running number
|
||||
try {
|
||||
barcode = await query(rnReplace, "labelData");
|
||||
const r: any = await query(rnReplace, "labelData");
|
||||
barcode = r?.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
createLog(
|
||||
|
||||
Reference in New Issue
Block a user