mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-12 06:57:47 +00:00
[https://github.com/HabitRPG/habitrpg/issues/1977] move sleep &
clear-completed to user.ops
This commit is contained in:
parent
ab5bd6d5af
commit
a5bf3440c8
2 changed files with 18 additions and 0 deletions
10
dist/habitrpg-shared.js
vendored
10
dist/habitrpg-shared.js
vendored
|
|
@ -10911,6 +10911,16 @@ var process=require("__browserify_process");(function() {
|
|||
}
|
||||
user._wrapped = true;
|
||||
user.ops = {
|
||||
sleep: function(req, cb) {
|
||||
user.flags.rest = !user.flags.rest;
|
||||
return cb(null, req);
|
||||
},
|
||||
clearCompleted: function(req, cb) {
|
||||
user.todos = _.where(user.todos, {
|
||||
completed: false
|
||||
});
|
||||
return cb(null, req);
|
||||
},
|
||||
update: function(req, cb) {
|
||||
_.each(req.body, function(v, k) {
|
||||
return user.fns.dotSet(k, v);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue