Skip to content

Commit

Permalink
Delete res.status for 200
Browse files Browse the repository at this point in the history
Move require to above the router def.
Relates #27
  • Loading branch information
SajedaIsmail committed Sep 24, 2019
1 parent 5c95ff7 commit 0b5ec3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/controllers/getMeals.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const getMeals = (req, res, next) => {
if (category) category = category.toLowerCase();
getMealsByCat(category)
.then((result) => (result.rows.length
? res.status(200).send({ statusCode: 200, data: result.rows })
? res.send({ statusCode: 200, data: result.rows })
: res.status(400).send({
statusCode: 400,
error: 'No such category',
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const express = require('express');
const postFeedback = require('./postFeedback');
const getMeals = require('./getMeals');

const router = express.Router();

const getMeals = require('./getMeals');

router.get('/meals', getMeals);
router.post('/post-feedback', postFeedback);
Expand Down

0 comments on commit 0b5ec3a

Please sign in to comment.