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

@@ -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 = {