From 887a0c3c8e6f6f633f6780c03b84dd77187b1f7d Mon Sep 17 00:00:00 2001 From: Jason Butz Date: Thu, 20 Mar 2014 16:56:34 -0400 Subject: [PATCH] Fix #730: id property ignored when updating task When calling the user.updateTask function if there was an id in the body it would override the id from the request URI --- script/index.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/index.coffee b/script/index.coffee index ead5a29225..6b6c717f82 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -505,7 +505,7 @@ api.wrap = (user, main=true) -> updateTask: (req, cb) -> return cb?({code:404,message:"Task not found"}) unless task = user.tasks[req.params?.id] - _.merge task, _.omit(req.body,'checklist') + _.merge task, _.omit(req.body,['checklist','id']) task.checklist = req.body.checklist if req.body.checklist task.markModified? 'tags' cb? null, task