mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
Remove user wrapping (#9960)
* remove user wrapping, fixes #9146 * update tests * fix tests
This commit is contained in:
@@ -607,7 +607,7 @@ api.scoreTask = {
|
||||
|
||||
let [delta] = common.ops.scoreTask({task, user, direction}, req);
|
||||
// Drop system (don't run on the client, as it would only be discarded since ops are sent to the API, not the results)
|
||||
if (direction === 'up') user.fns.randomDrop({task, delta}, req, res.analytics);
|
||||
if (direction === 'up') common.fns.randomDrop(user, {task, delta}, req, res.analytics);
|
||||
|
||||
// If a todo was completed or uncompleted move it in or out of the user.tasksOrder.todos list
|
||||
// TODO move to common code?
|
||||
|
||||
@@ -470,7 +470,7 @@ api.getUserAnonymized = {
|
||||
let user = res.locals.user.toJSON();
|
||||
user.stats.toNextLevel = common.tnl(user.stats.lvl);
|
||||
user.stats.maxHealth = common.maxHealth;
|
||||
user.stats.maxMP = res.locals.user._statsComputed.maxMP;
|
||||
user.stats.maxMP = common.statsComputed(res.locals.user).maxMP;
|
||||
|
||||
delete user.apiToken;
|
||||
if (user.auth) {
|
||||
|
||||
Reference in New Issue
Block a user