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

@@ -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,