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