Permalink
Browse files

Update: PUT /todos/:id

  • Loading branch information...
amejiarosario committed Oct 2, 2014
1 parent 7d8bc67 commit 00dafe491e0d0b59fa53e86d8c187c42d7824200
Showing with 8 additions and 0 deletions.
  1. +8 −0 routes/todos.js
View
@@ -28,4 +28,12 @@ router.get('/:id', function(req, res, next) {
});
});
+/* PUT /todos/:id */
+router.put('/:id', function(req, res, next) {
+ Todo.findByIdAndUpdate(req.params.id, req.body, function (err, post) {
+ if (err) return next(err);
+ res.json(post);
+ });
+});
+
module.exports = router;

0 comments on commit 00dafe4

Please sign in to comment.