From 3f19a78c22737c257bfbe473c49a6d1d5d4cbd73 Mon Sep 17 00:00:00 2001 From: floydpraveen Date: Thu, 22 Aug 2013 17:52:16 +0530 Subject: [PATCH] added is_completed in put call --- server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index fa744d5..6e1c838 100644 --- a/server.js +++ b/server.js @@ -44,8 +44,9 @@ app.post('/tasks', function(req,res){ }); app.put('/tasks/:id', function(req,res){ + console.log(req.body.is_completed); var timestamp = Math.round((new Date()).getTime()/1000); - client.query("UPDATE tasks SET content = ?, timestamp = ? WHERE id = ?", [req.body.content,timestamp,req.body.id], function(err, task){ + client.query("UPDATE tasks SET content = ?, timestamp = ?, is_completed = ? WHERE id = ?", [req.body.content, timestamp, req.body.is_completed, req.body.id], function(err, task){ req.body.timestamp = timestamp; res.send(req.body); });