clear-completed to user.ops
This commit is contained in:
Tyler Renelle
2013-12-12 17:00:42 -07:00
parent ab5bd6d5af
commit a5bf3440c8
2 changed files with 18 additions and 0 deletions
+8
View File
@@ -629,6 +629,14 @@ api.wrap = (user) ->
user.ops =
sleep: (req, cb) ->
user.flags.rest = !user.flags.rest
cb null, req
clearCompleted: (req, cb) ->
user.todos = _.where(user.todos, {completed: false})
cb null, req
update: (req, cb) ->
_.each req.body, (v,k) ->
user.fns.dotSet(k,v)