mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
fix(api): correct world, cap level
This commit is contained in:
@@ -166,7 +166,9 @@ export async function update (req, res, { isV3 = false }) {
|
||||
user.flags.lastNewStuffRead = lastNewsPost._id;
|
||||
}
|
||||
} else if (acceptablePUTPaths[key]) {
|
||||
_.set(user, key, val);
|
||||
let adjustedVal = val;
|
||||
if (key === 'stats.lvl' && val > 999) adjustedVal = 999;
|
||||
_.set(user, key, adjustedVal);
|
||||
} else {
|
||||
throw new NotAuthorized(res.t('messageUserOperationProtected', { operation: key }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user