refactor(sql): improved the return function to show data [] when not connected, prevents crashes
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user