refactor(datamart): changes to customer inventory to include specific whse
This commit is contained in:
@@ -28,8 +28,8 @@ const current: any = [
|
||||
name: "getCustomerInventory",
|
||||
endpoint: "/api/datamart/getcustomerinventory",
|
||||
description:
|
||||
"Returns specific customer inventory based on there address ID.",
|
||||
criteria: "customer",
|
||||
"Returns specific customer inventory based on there address ID, with optional to include warehouses, IE 36,41,5. leaving warehouse blank will just pull everything",
|
||||
criteria: "customer,whseToInclude",
|
||||
},
|
||||
// {
|
||||
// name: "getPalletLabels",
|
||||
|
||||
@@ -25,12 +25,12 @@ app.openapi(
|
||||
responses: responses(),
|
||||
}),
|
||||
async (c) => {
|
||||
const customer: string = c.req.query("customer") ?? "";
|
||||
const customerData: any = c.req.queries();
|
||||
|
||||
// make sure we have a vaid user being accessed thats really logged in
|
||||
apiHit(c, { endpoint: "/getcustomerinventory" });
|
||||
const { data, error } = await tryCatch(
|
||||
getCurrentCustomerInv(customer ? customer : null)
|
||||
getCurrentCustomerInv(customerData ? customerData : null)
|
||||
);
|
||||
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user