mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-26 21:24:08 +00:00
11 lines
301 B
JavaScript
11 lines
301 B
JavaScript
|
|
import _ from 'lodash';
|
||
|
|
|
||
|
|
module.exports = function(user, req, cb) {
|
||
|
|
_.times(user.stats.points, user.fns.autoAllocate);
|
||
|
|
user.stats.points = 0;
|
||
|
|
if (typeof user.markModified === "function") {
|
||
|
|
user.markModified('stats');
|
||
|
|
}
|
||
|
|
return typeof cb === "function" ? cb(null, user.stats) : void 0;
|
||
|
|
};
|