From 31c63906173bfb6033846a9cb3e94336f3d0f03b Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 27 Nov 2020 02:31:30 -0500 Subject: [PATCH] if multiple result sets are involved then `res` is an array, specificy second result set --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9639fc7..c07a75d 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,7 @@ Postgres.connect(); Postgres.FirstRow = function(inSQL, args, inResponse) { Postgres.query(inSQL, args, (err, res) => { if (err === null) { - inResponse.json(res.rows[0]); + inResponse.json(res[1].rows[0]); return; } console.log(err.stack);