handled a returned array as opposed to a returned object
This commit is contained in:
parent
3d9bc487ba
commit
0b5ee0bdf3
8
index.js
8
index.js
@ -39,8 +39,12 @@ Postgres.FirstRow = function(inSQL, args, inResponse) {
|
||||
if (err === null) {
|
||||
//need to test if the response is an object or an array
|
||||
//inResponse.json(res.rows[0]);
|
||||
//if (Array.isArray(res)) {}
|
||||
inResponse.json(res[1].rows[0]);
|
||||
if (Array.isArray(res)) {
|
||||
inResponse.json(res[1].rows[0]);
|
||||
}
|
||||
else {
|
||||
inResponse.json(res.rows[0]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
console.log(err.stack);
|
||||
|
Loading…
Reference in New Issue
Block a user