From 5c95ff796bc6587a3de10063dc642a421eea0d75 Mon Sep 17 00:00:00 2001 From: SajedaIsmail Date: Tue, 24 Sep 2019 14:49:59 +0300 Subject: [PATCH] Fix eslint errors Relates #27 --- server/controllers/getMeals.js | 4 ++-- server/database/queries/getMealsByCat.js | 6 +++--- test/getMeals.test.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/controllers/getMeals.js b/server/controllers/getMeals.js index 3c964d2..51881f3 100644 --- a/server/controllers/getMeals.js +++ b/server/controllers/getMeals.js @@ -8,8 +8,8 @@ const getMeals = (req, res, next) => { ? res.status(200).send({ statusCode: 200, data: result.rows }) : res.status(400).send({ statusCode: 400, - error: 'No such category' - })),) + error: 'No such category', + }))) .catch((err) => next(err)); }; diff --git a/server/database/queries/getMealsByCat.js b/server/database/queries/getMealsByCat.js index ffd2169..5a11ede 100644 --- a/server/database/queries/getMealsByCat.js +++ b/server/database/queries/getMealsByCat.js @@ -1,8 +1,8 @@ const connection = require('../../database/config/connection'); const getMealsByCat = (categoryName) => connection.query( - 'Select c.name as category, m.* from menu_category c inner join meal m on (c.id = m.category_id) where c.name=$1', - [categoryName], - ); + 'Select c.name as category, m.* from menu_category c inner join meal m on (c.id = m.category_id) where c.name=$1', + [categoryName], +); module.exports = getMealsByCat; diff --git a/test/getMeals.test.js b/test/getMeals.test.js index dbb525c..232fc1d 100644 --- a/test/getMeals.test.js +++ b/test/getMeals.test.js @@ -20,8 +20,8 @@ module.exports = test('Testing for getMeals route', (t) => { 200, 'The code value must be 200 in the response body', ); - res.body.data.forEach((ele) => t.equal(ele.category_id, 1, 'All category ids must be 1'),); - res.body.data.forEach((ele) => t.equal(ele.category, 'main', 'All category names must be main'),); + res.body.data.forEach((ele) => t.equal(ele.category_id, 1, 'All category ids must be 1')); + res.body.data.forEach((ele) => t.equal(ele.category, 'main', 'All category names must be main')); t.end(); }); });