Skip to content

Commit

Permalink
Fix eslint errors
Browse files Browse the repository at this point in the history
Relates #27
  • Loading branch information
SajedaIsmail committed Sep 24, 2019
1 parent ab11199 commit 5c95ff7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions server/controllers/getMeals.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};

Expand Down
6 changes: 3 additions & 3 deletions server/database/queries/getMealsByCat.js
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions test/getMeals.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
Expand Down

0 comments on commit 5c95ff7

Please sign in to comment.