From 5074f5b8e514895eed1f523679b6a48229e3daae Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 3 Nov 2023 16:11:32 -0400 Subject: [PATCH] vault backup: 2023-11-03 16:11:32 --- api.ts | 10 ++++++---- sql/get.pg.sql | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/api.ts b/api.ts index 3de5973..560916c 100644 --- a/api.ts +++ b/api.ts @@ -32,14 +32,16 @@ await client.connect(); const query = await Deno.readTextFile("sql/get.pg.sql"); // Define a route to retrieve values from the database using parameters -router.get('/price_info/part_cust/:partcode/:customer', async (ctx) => { +router.get('/code_price/:billcode/:shipcode/:partcode/:qty', async (ctx) => { - const partcode = ctx.params.partcode; // Extract the partcode parameter from the route - const customer = ctx.params.customer; // Extract the customer parameter from the route + const partcode = ctx.params.partcode; + const billcode = ctx.params.billcode; + const shipcode = ctx.params.shipcode; + const qty = ctx.params.qty; //console.log(partcode) //console.log(customer) - const result = await client.queryObject({args: [customer, customer, partcode], text: query} ); + const result = await client.queryObject({args: [billcode, shipcode, partcode, qty], text: query} ); ctx.response.body = result.rows; }); diff --git a/sql/get.pg.sql b/sql/get.pg.sql index 795e8cb..cd46d76 100644 --- a/sql/get.pg.sql +++ b/sql/get.pg.sql @@ -1,2 +1,2 @@ --select gg.d from rlarp.get_guidance('DIAM0004','DIAM0004','AMK06000G18B054',5000,2024) gg(d); -select gg.d doc from rlarp.get_guidance($1,$2, $3, 5000,2024) gg(d); +select gg.d doc from rlarp.get_guidance($1,$2, $3, $4,2024) gg(d);