treat inbound json as array of targets to oterate through call db func on each
This commit is contained in:
parent
0e9d2f5cb2
commit
136bb030c9
@ -54,8 +54,11 @@ server.get("/source", function (inReq, inRes)
|
|||||||
//returns message about status and error description
|
//returns message about status and error description
|
||||||
server.post("/source", bodyParser.json(), function (inReq, inRes)// remove body parsing, just pass post body to the sql string build
|
server.post("/source", bodyParser.json(), function (inReq, inRes)// remove body parsing, just pass post body to the sql string build
|
||||||
{
|
{
|
||||||
|
x = inReq.body;
|
||||||
|
for (var i =0; i < x.length; i++) {
|
||||||
var sql = "SELECT x.message FROM tps.srce_set($1::jsonb) as x(message)";
|
var sql = "SELECT x.message FROM tps.srce_set($1::jsonb) as x(message)";
|
||||||
Postgres.FirstRow(sql,[JSON.stringify(inReq.body)], inRes);
|
Postgres.FirstRow(sql,[JSON.stringify(x[i])], inRes);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//----------------------------------------------------------regex instrUctions-------------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------regex instrUctions-------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user