habitica/common/script/ops/allocateNow.js

11 lines
253 B
JavaScript
Raw Normal View History

2016-03-07 22:02:42 +00:00
import _ from 'lodash';
2016-03-20 19:21:15 +00:00
import autoAllocate from '../fns/autoAllocate';
2016-03-07 22:02:42 +00:00
2016-03-20 19:21:15 +00:00
module.exports = function allocateNow (user) {
_.times(user.stats.points, () => autoAllocate(user));
2016-03-07 22:02:42 +00:00
user.stats.points = 0;
2016-03-20 19:21:15 +00:00
return {
data: _.pick(user, 'stats'),
};
2016-03-07 22:02:42 +00:00
};