refactor(sql): improved the return function to show data [] when not connected, prevents crashes
This commit is contained in:
@@ -17,7 +17,7 @@ export const getLanesToCycleCount = async () => {
|
||||
createLog("info", "warehouse", "logistics", "Lane triggered update.");
|
||||
lastCheck = currentTime;
|
||||
const ageQuery = cycleCountCheck.replaceAll("[ageOfRow]", "90");
|
||||
const { data: prodLanes, error: pl } = await tryCatch(
|
||||
const { data: p, error: pl } = await tryCatch(
|
||||
query(ageQuery, "Get Stock lane date.")
|
||||
);
|
||||
|
||||
@@ -31,6 +31,8 @@ export const getLanesToCycleCount = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const prodLanes: any = p?.data;
|
||||
|
||||
// run the update on the lanes
|
||||
for (let i = 0; i < prodLanes.length; i++) {
|
||||
const createLane = {
|
||||
|
||||
Reference in New Issue
Block a user