refactor(sql): improved the return function to show data [] when not connected, prevents crashes
This commit is contained in:
@@ -7,15 +7,21 @@ import { ocmeCycleCounts } from "../../../../database/schema/ocmeCycleCounts.js"
|
||||
import { db } from "../../../../database/dbclient.js";
|
||||
import { tryCatch } from "../../../globalUtils/tryCatch.js";
|
||||
import { createLog } from "../../logger/logger.js";
|
||||
import { prodEndpointCreation } from "../../../globalUtils/createUrl.js";
|
||||
|
||||
export const prepareLane =
|
||||
"https://usday1prod.alpla.net/application/public/v1.1/Warehousing/PrepareLaneForInventory";
|
||||
export const openLane =
|
||||
"https://usday1prod.alpla.net/application/public/v1.0/Warehousing/InventoryOpen";
|
||||
export const closeLane =
|
||||
"https://usday1prod.alpla.net/application/public/v1.0/Warehousing/InventoryClose";
|
||||
export const releaseLane =
|
||||
"https://usday1prod.alpla.net/application/public/v1.1/Warehousing/ReleaseLaneFromInventory";
|
||||
export const prepareLane = await prodEndpointCreation(
|
||||
"/public/v1.1/Warehousing/PrepareLaneForInventory"
|
||||
);
|
||||
|
||||
export const openLane = await prodEndpointCreation(
|
||||
"/public/v1.0/Warehousing/InventoryOpen"
|
||||
);
|
||||
export const closeLane = await prodEndpointCreation(
|
||||
"/public/v1.0/Warehousing/InventoryClose"
|
||||
);
|
||||
export const releaseLane = await prodEndpointCreation(
|
||||
"/public/v1.1/Warehousing/ReleaseLaneFromInventory"
|
||||
);
|
||||
export const scannerID = 500;
|
||||
export const cycleCount = async (lane: any, user: User) => {
|
||||
/**
|
||||
@@ -27,7 +33,7 @@ export const cycleCount = async (lane: any, user: User) => {
|
||||
const ocme = await ocmeInv(lane);
|
||||
|
||||
// get alpla stock data
|
||||
const alplaStock = await alplaStockInv(ocme[0].alpla_laneID);
|
||||
const alplaStock: any = await alplaStockInv(ocme[0].alpla_laneID);
|
||||
|
||||
// create a new array that has the merge happen.
|
||||
const mergeOcmeData = ocme.map((d: any) => {
|
||||
|
||||
Reference in New Issue
Block a user