Skip to content

Commit

Permalink
Fix error when temp token not supplied and escape empty rows
Browse files Browse the repository at this point in the history
  • Loading branch information
ciremusyoka committed Aug 19, 2024
1 parent 9ddcea8 commit 1fe5086
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function build() {
}
})
.catch((error) => {
req.log.error(err)
req.log.error(error)
done(error.detail);
});
} else if ("/health-check" == req.url) {
Expand Down
4 changes: 2 additions & 2 deletions routes/bounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const schema = {
querystring: {
form_id: {
type: 'string',
description: 'Form is',
description: 'Form id',
},
limit: {
type: 'string',
Expand Down Expand Up @@ -62,7 +62,7 @@ module.exports = function (fastify, opts, next) {
if (err) {
reply.code(400).send(err)
} else {
if(result.rows > 0) {
if(result.rows?.length > 0) {
reply.send(result.rows[0])
} else {
reply.code(404).send({error: 'No data found' });
Expand Down

0 comments on commit 1fe5086

Please sign in to comment.