refactor(sql): improved the return function to show data [] when not connected, prevents crashes
This commit is contained in:
@@ -77,9 +77,11 @@ export const tiImport = async () => {
|
||||
.replaceAll("[exclude]", releaseString);
|
||||
|
||||
// get the headers pending
|
||||
const { data: header, error: headerError } = await tryCatch(
|
||||
const { data: h, error: headerError } = await tryCatch(
|
||||
query(orders, "Ti get open headers")
|
||||
);
|
||||
const header: any = h?.data as any;
|
||||
|
||||
if (headerError) {
|
||||
createLog(
|
||||
"error",
|
||||
@@ -127,9 +129,11 @@ export const tiImport = async () => {
|
||||
.replaceAll("[to]", notiSet[0].notifiySettings.end);
|
||||
|
||||
// get the headers pending
|
||||
const { data: orderData, error: ordersError } = await tryCatch(
|
||||
const { data: o, error: ordersError } = await tryCatch(
|
||||
query(orderToSend, "Ti get open headers")
|
||||
);
|
||||
|
||||
const orderData: any = o?.data as any;
|
||||
if (ordersError)
|
||||
return {
|
||||
success: false,
|
||||
|
||||
Reference in New Issue
Block a user