mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
feat(archive_todo): update to archive todos
I thought this bit of code was in the other repo. So long as part 3 follows close behind this, there shouldn't be an issue
This commit is contained in:
parent
17aed0a9d7
commit
52ff5a7d5a
1 changed files with 3 additions and 1 deletions
|
|
@ -485,7 +485,9 @@ api.wrap = (user, main=true) ->
|
|||
# ------
|
||||
|
||||
clearCompleted: (req, cb) ->
|
||||
_.remove user.todos, (t)-> t.completed and !t.challenge?.id
|
||||
user.todos = _.map user.todos, (t)->
|
||||
t.archived = true if t.completed and !t.challenge?.id
|
||||
t
|
||||
user.markModified? 'todos'
|
||||
cb? null, user.todos
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue