mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
added cron update on each transaction.
This commit is contained in:
parent
a9dd42cda5
commit
50918ffea8
1 changed files with 7 additions and 0 deletions
|
|
@ -53,6 +53,13 @@ router.post '/', auth, (req, res) ->
|
|||
console.log util.inspect req.body
|
||||
|
||||
|
||||
misc.batchTxn model, (uObj, paths) ->
|
||||
# habitrpg-shared/algos requires uObj.habits, uObj.dailys etc instead of uObj.tasks
|
||||
_.each ['habit','daily','todo','reward'], (type) -> uObj["#{type}s"] = _.where(uObj.tasks, {type}); true
|
||||
algos.cron uObj, {paths}
|
||||
,{cron:true}
|
||||
|
||||
|
||||
_.each ['habit', 'daily', 'todo', 'reward'], (type) ->
|
||||
model.refList "_#{type}List", "_user.tasks", "_user.#{type}Ids"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue