From fb06a6490e1abcb56d2ca11a7e1ad812dceb943f Mon Sep 17 00:00:00 2001 From: kumar dam Date: Sat, 29 Apr 2017 21:38:53 -0400 Subject: fixed all indents --- app/routes.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/routes.js b/app/routes.js index 7b596dc..724af11 100644 --- a/app/routes.js +++ b/app/routes.js @@ -1,18 +1,15 @@ // get the todos collection var todoCollect = require('./models/todo'); - // use mongo to get all the items in db function getTodos (res) { todoCollect.find(function (err, todos) { if (err) res.send(err); - - res.json(todos); // return all todos in JSON format - // console.log(todos); + // return all todos in JSON format + res.json(todos); }); } - // ===========================API=============================== module.exports = function (app) { @@ -30,7 +27,6 @@ module.exports = function (app) { done: false }, function (err, todo) { if (err) res.send(err); - // 'refresh' to-do list getTodos(res); }); @@ -43,7 +39,6 @@ module.exports = function (app) { _id: req.params.todo_id }, function (err, todo) { if (err) res.send(err); - // 'refresh' to-do list getTodos(res); }); @@ -53,4 +48,4 @@ module.exports = function (app) { app.get('*', function (req, res) { res.sendFile(__dirname + '/public/index.html'); }); -}; \ No newline at end of file +}; -- cgit v1.2.3