From cfa7960157464c85f693d3fe2ac96f6497ad108b Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 3 Nov 2023 14:34:27 -0400 Subject: [PATCH] vault backup: 2023-11-03 14:34:27 --- api.ts | 4 ++-- sql/get.pg.sql | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 sql/get.pg.sql diff --git a/api.ts b/api.ts index d8407c0..3de5973 100644 --- a/api.ts +++ b/api.ts @@ -29,7 +29,7 @@ const client = new Client({ await client.connect(); // Load SQL from file -const query = await Deno.readTextFile("sql/hist.sql"); +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) => { @@ -39,7 +39,7 @@ router.get('/price_info/part_cust/:partcode/:customer', async (ctx) => { //console.log(partcode) //console.log(customer) - const result = await client.queryObject({args: [partcode, customer], text: query} ); + const result = await client.queryObject({args: [customer, customer, partcode], text: query} ); ctx.response.body = result.rows; }); diff --git a/sql/get.pg.sql b/sql/get.pg.sql new file mode 100644 index 0000000..7c454d0 --- /dev/null +++ b/sql/get.pg.sql @@ -0,0 +1,2 @@ +--select gg.d from rlarp.get_guidance('DIAM0004','DIAM0004','AMK06000G18B054',5000,2024) gg(d); +select gg.d from rlarp.get_guidance($1,$2, $3, 5000,2024) gg(d);