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());