if multiple result sets are involved then res is an array, specificy second result set

This commit is contained in:
Paul Trowbridge 2020-11-27 02:31:30 -05:00
parent 3b3a2f7b39
commit 31c6390617

View File

@ -37,7 +37,7 @@ Postgres.connect();
Postgres.FirstRow = function(inSQL, args, inResponse) { Postgres.FirstRow = function(inSQL, args, inResponse) {
Postgres.query(inSQL, args, (err, res) => { Postgres.query(inSQL, args, (err, res) => {
if (err === null) { if (err === null) {
inResponse.json(res.rows[0]); inResponse.json(res[1].rows[0]);
return; return;
} }
console.log(err.stack); console.log(err.stack);