Merge branch 'hist_list' into feature/cust_swap

This commit is contained in:
Paul Trowbridge 2020-05-12 15:27:23 -04:00
commit 3592120b54
2 changed files with 11 additions and 2 deletions

View File

@ -238,10 +238,19 @@ server.get('/list_changes', bodyParser.json(), function(req, res) {
var callback = function(arg) { var callback = function(arg) {
sql = arg; sql = arg;
//parse request body into a where clause
({ c, w, d } = build_where(req, c, w, d, args));
//if there was no body sent, return with nothing
if (c == 1) {
res.send("no body was sent");
return;
}
console.log(new Date().toISOString() + "-------------------------list changes:------------------------------") console.log(new Date().toISOString() + "-------------------------list changes:------------------------------")
console.log(req.body); console.log(req.body);
//parse the where clause into the main sql statement //parse the where clause into the main sql statement
sql = sql.replace(new RegExp("replace_user", 'g'), req.body.quota_rep_descr) sql = sql.replace(new RegExp("where_clause", 'g'), w)
//execute the sql and send the result //execute the sql and send the result
console.log(sql); console.log(sql);
Postgres.FirstRow(sql, [], res) Postgres.FirstRow(sql, [], res)

View File

@ -14,7 +14,7 @@ from
inner join rlarp.osm_pool on inner join rlarp.osm_pool on
id = logid id = logid
WHERE WHERE
quota_rep_descr = 'replace_user' where_clause
AND tag <> 'Initial Build' AND tag <> 'Initial Build'
group BY group BY
ol.doc->>'user' ol.doc->>'user'