Skip to content

Commit

Permalink
Update todos.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rajats98 authored Jan 15, 2020
1 parent 2827cd7 commit 0d752b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpers/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var db = require('../models');
exports.getTodos = function(req,res) {
db.Todo.find()
.then(function(todos) {
res.status(201).json(todos);
res.json(todos);
})
.catch(function(err) {
res.send(err);
Expand All @@ -13,7 +13,7 @@ exports.getTodos = function(req,res) {
exports.createTodo = function(req,res){
db.Todo.create(req.body)
.then(function(newTodo) {
res.json(newTodo);
res.status(201).json(newTodo);
})
.catch(function(err) {
res.send(err);
Expand Down Expand Up @@ -50,4 +50,4 @@ exports.deleteTodo = function(req,res){
})
}

module.exports = exports;
module.exports = exports;

0 comments on commit 0d752b4

Please sign in to comment.