From 784095dd7fcd4648db60cf825a05821ac10322d1 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 10 Nov 2023 16:08:54 -0500 Subject: [PATCH] vault backup: 2023-11-10 16:08:54 --- api.ts | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/api.ts b/api.ts index 95d37f3..7f94305 100644 --- a/api.ts +++ b/api.ts @@ -35,29 +35,16 @@ const query_dseg = await Deno.readTextFile("sql/get_dseg.pg.sql"); // exact scenario for existing codes router.get('/code_price/:billcode/:shipcode/:partcode/:qty', async (ctx) => { - - const partcode = ctx.params.partcode; - const billcode = ctx.params.billcode; - const shipcode = ctx.params.shipcode; - const qty = ctx.params.qty; - + const { billcode, shipcode, partcode, qty } = ctx.params; const result = await client.queryObject({args: [billcode, shipcode, partcode, qty], text: query} ); - const procd = apply_guidance(result.rows[0]["doc"]) - ctx.response.body = procd; + ctx.response.body = apply_guidance(result.rows[0]["doc"]); }); // specific customres codes but generic style code and data segment to accomodate custom colors and branding router.get('/dseg_price/:billcode/:shipcode/:stlc/:dseg/:qty', async (ctx) => { - - const stlc = ctx.params.stlc; - const dseg = ctx.params.dseg; - const billcode = ctx.params.billcode; - const shipcode = ctx.params.shipcode; - const qty = ctx.params.qty; - + const { billcode, shipcode, stlc, dseg, qty } = ctx.params; const result = await client.queryObject({args: [billcode, shipcode, stlc, dseg, qty], text: query_dseg} ); - const procd = apply_guidance(result.rows[0]["doc"]) - ctx.response.body = procd; + ctx.response.body = apply_guidance(result.rows[0]["doc"]); }); app.use(router.routes()); app.use(router.allowedMethods());