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
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user