refactor(sql): improved the return function to show data [] when not connected, prevents crashes

This commit is contained in:
2025-04-24 21:24:39 -05:00
parent 3573fd1a5b
commit ead63d4b41
36 changed files with 323 additions and 141 deletions

View File

@@ -38,8 +38,8 @@ export const dualPrintingProcess = async (lotInfo: any) => {
try {
// get what was last printed
const result = await query(printedQuery, "Last Printed Query");
lastPrinted = result[0].IdMaschine;
const result: any = await query(printedQuery, "Last Printed Query");
lastPrinted = result.data[0].IdMaschine;
} catch (err) {
createLog(
"error",
@@ -51,8 +51,8 @@ export const dualPrintingProcess = async (lotInfo: any) => {
try {
// get if if running or down
const first = await query(fisrtLineDT, "First line DT Check");
firstLine = first[0].LineCheck;
const first: any = await query(fisrtLineDT, "First line DT Check");
firstLine = first.data[0].LineCheck;
} catch (err) {
createLog(
"error",
@@ -63,8 +63,8 @@ export const dualPrintingProcess = async (lotInfo: any) => {
}
try {
const second = await query(secondLineDT, "Second line DT Check");
secondLine = second[0].LineCheck;
const second: any = await query(secondLineDT, "Second line DT Check");
secondLine = second.data[0].LineCheck;
} catch (err) {
createLog(
"error",