Skip to content

Commit

Permalink
bug(article-comments): Fix the get article comment endpoint response
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmme committed Mar 5, 2019
1 parent 8068956 commit 6898da8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/controllers/CommentController.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,16 @@ class CommentController {
include: [
{
model: User,
attributes: ['userName', 'img']
attributes: ['userName', 'img', 'fullName']
}
],
where: {
articleId: articleFound.dataValues.id
},
attributes: []
}
});

if (commentsQuery.length === 0) {
return response(res, 404, 'failure', 'Comment with the articleId not found', null, null);
return response(res, 200, 'success', 'No comment yet on the article', null, []);
}

const comments = [];
Expand Down

0 comments on commit 6898da8

Please sign in to comment.