From 4dfa2a709a2e90d6901ea83546ce5b2f726352f9 Mon Sep 17 00:00:00 2001 From: Anguandia Date: Thu, 7 Nov 2019 06:34:54 +0200 Subject: [PATCH] rebase from develop --- src/controllers/articles.controller.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/controllers/articles.controller.js b/src/controllers/articles.controller.js index f89fcca..5aacd79 100644 --- a/src/controllers/articles.controller.js +++ b/src/controllers/articles.controller.js @@ -128,7 +128,9 @@ class Articles { lastname, image }; - const rating = await RateService.getArticleRatingStatistic(article.slug); + const rating = await RateService.getArticleRatingStatistic( + article.slug + ); let claps = await likeService.getAllAClaps(article.slug); claps = Object.values(claps)[0]; const readTime = Helper.calculateReadTime(article.body); @@ -333,7 +335,10 @@ class Articles { return util.send(res); } if (req.auth.id !== findArticle.authorId) { - util.setError(403, 'Sorry you can not DELETE an article that does not belong to you.'); + util.setError( + 403, + 'Sorry you can not DELETE an article that does not belong to you.' + ); return util.send(res); } await db.destroy({ @@ -361,10 +366,15 @@ class Articles { return util.send(res); } if (req.auth.id !== findArticle.authorId) { - util.setError(401, 'Sorry you can not UPDATE an article that does not belong to you.'); + util.setError( + 401, + 'Sorry you can not UPDATE an article that does not belong to you.' + ); return util.send(res); } - const { title, body, description, images, } = req.body; + const { + title, body, description, images + } = req.body; const updatedArticle = await articleService.updateArticle(req.params.slug, { title, body,