refactor(sql): improved the return function to show data [] when not connected, prevents crashes
This commit is contained in:
@@ -31,7 +31,7 @@ export const createSiloAdjustment = async (
|
||||
}
|
||||
|
||||
// getting stock data first so we have it prior to the adjustment
|
||||
const { data: stock, error: stockError } = await tryCatch(
|
||||
const { data: s, error: stockError } = await tryCatch(
|
||||
query(siloQuery, "Silo data Query")
|
||||
);
|
||||
|
||||
@@ -42,7 +42,7 @@ export const createSiloAdjustment = async (
|
||||
data: stockError,
|
||||
};
|
||||
}
|
||||
|
||||
const stock: any = s?.data as any;
|
||||
const { data: a, error: errorAdj } = await tryCatch(
|
||||
postAdjustment(data, user.prod)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user