From a7f2e1781f561246a2a2f1da9dbab226551407f4 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 19 Dec 2018 00:34:01 -0500 Subject: [PATCH] update for new loading function in the DB --- server.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server.js b/server.js index 33f3cf9..c104a90 100644 --- a/server.js +++ b/server.js @@ -61,11 +61,8 @@ server.post("/source_single", bodyParser.json(), function (inReq, inRes)// remov server.post("/source", bodyParser.json(), function (inReq, inRes)// remove body parsing, just pass post body to the sql string build { x = inReq.body; - var sql = "SELECT\ - jsonb_agg(jsonb_build_object('name',d.def->>'name')||x.message) top_message \ - FROM\ - jsonb_array_elements($1::jsonb) d(def)\ - JOIN LATERAL tps.srce_set(d.def) x(message) ON TRUE"; + var sql = "SELECT x.message FROM tps.srce_overwrite_all($1::jsonb) x(message)"; + console.log(JSON.stringify(inReq.body)); Postgres.FirstRow(sql,[JSON.stringify(inReq.body)], inRes); });