mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
wip: fix setting (some) items values in the hall of heroes (#11133)
This commit is contained in:
@@ -7,7 +7,10 @@ import {
|
||||
import _ from 'lodash';
|
||||
import apiError from '../../libs/apiError';
|
||||
import validator from 'validator';
|
||||
import { validateItemPath } from '../../libs/items/utils';
|
||||
import {
|
||||
validateItemPath,
|
||||
castItemVal,
|
||||
} from '../../libs/items/utils';
|
||||
|
||||
|
||||
let api = {};
|
||||
@@ -271,7 +274,7 @@ api.updateHero = {
|
||||
hero.markModified('items.pets');
|
||||
}
|
||||
if (updateData.itemPath && updateData.itemVal && validateItemPath(updateData.itemPath)) {
|
||||
_.set(hero, updateData.itemPath, updateData.itemVal); // Sanitization at 5c30944 (deemed unnecessary)
|
||||
_.set(hero, updateData.itemPath, castItemVal(updateData.itemPath, updateData.itemVal)); // Sanitization at 5c30944 (deemed unnecessary)
|
||||
}
|
||||
|
||||
if (updateData.auth && updateData.auth.blocked === true) {
|
||||
|
||||
Reference in New Issue
Block a user