From 29e7be99f32e669ac725dbca782cc89c9bf763a3 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 3 Nov 2023 21:16:26 -0400 Subject: [PATCH] vault backup: 2023-11-03 21:16:26 --- api.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api.ts b/api.ts index 560916c..d092fc9 100644 --- a/api.ts +++ b/api.ts @@ -31,6 +31,10 @@ await client.connect(); // Load SQL from file const query = await Deno.readTextFile("sql/get.pg.sql"); +function apply_guidance(doc: any) { + return doc; +} + // Define a route to retrieve values from the database using parameters router.get('/code_price/:billcode/:shipcode/:partcode/:qty', async (ctx) => { @@ -42,7 +46,8 @@ router.get('/code_price/:billcode/:shipcode/:partcode/:qty', async (ctx) => { //console.log(partcode) //console.log(customer) const result = await client.queryObject({args: [billcode, shipcode, partcode, qty], text: query} ); - ctx.response.body = result.rows; + const procd = apply_guidance(result.rows[0]["doc"]) + ctx.response.body = procd }); app.use(router.routes());