mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
fix reroll
This commit is contained in:
parent
ba8a8d2494
commit
e84aa13d62
1 changed files with 1 additions and 3 deletions
|
|
@ -178,8 +178,6 @@ api.deleteTask = function(req, res, next) {
|
||||||
/*
|
/*
|
||||||
Update Task
|
Update Task
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
api.updateTask = function(req, res, next) {
|
api.updateTask = function(req, res, next) {
|
||||||
var user = res.locals.user;
|
var user = res.locals.user;
|
||||||
var task = user.tasks[req.params.id];
|
var task = user.tasks[req.params.id];
|
||||||
|
|
@ -366,7 +364,7 @@ api.reroll = function(req, res, next) {
|
||||||
if (user.balance < 1) return res.json(401, {err: "Not enough tokens."});
|
if (user.balance < 1) return res.json(401, {err: "Not enough tokens."});
|
||||||
user.balance -= 1;
|
user.balance -= 1;
|
||||||
_.each(['habits','dailys','todos'], function(type){
|
_.each(['habits','dailys','todos'], function(type){
|
||||||
_.each([user[type+'s']], function(task){
|
_.each(user[type], function(task){
|
||||||
task.value = 0;
|
task.value = 0;
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue