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

@@ -12,12 +12,15 @@ export const getCurrentCustomerInv = async (customer: any | null) => {
);
}
try {
const inventory = await query(updatedQuery, "Get active inventory");
const inventory: any = await query(
updatedQuery,
"Get active inventory"
);
return {
success: true,
message: "All customer inventory minus holds",
data: inventory,
data: inventory.data,
};
} catch (error) {
return {