Skip to content

Commit

Permalink
Merge 7c162bb into 08f1e18
Browse files Browse the repository at this point in the history
  • Loading branch information
iamuchejude committed Sep 17, 2018
2 parents 08f1e18 + 7c162bb commit 1cffbfa
Show file tree
Hide file tree
Showing 2 changed files with 353 additions and 110 deletions.
6 changes: 4 additions & 2 deletions server/controllers/likeDislike.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class likesDislikesController {
const { userId } = req;
const { reaction } = req.body;

if (!articleId || articleId.trim().length < 1) {
if (!articleId) {
return res.status(400).json({
status: 'error',
error: {
Expand Down Expand Up @@ -64,6 +64,7 @@ class likesDislikesController {
LikesDislikes.findOne({
where: {
userId,
articleId,
}
})
.then((likeOrDislike) => {
Expand Down Expand Up @@ -117,7 +118,8 @@ class likesDislikesController {
*/
static getLikesDislikes(req, res, next) {
const { articleId } = req.params;
if (!articleId || articleId.trim().length < 1) {

if (!articleId) {
return res.status(400).json({
status: 'error',
error: {
Expand Down
Loading

0 comments on commit 1cffbfa

Please sign in to comment.