mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Fix challenge update (#11148)
* Fix challenge update Fix some problem in challenge update * Fix test * Move leader to noUpdate * Move leader to noUpdate
This commit is contained in:
committed by
Matteo Pagliazzi
parent
d8ea3bd23a
commit
c0837e3b3c
@@ -62,7 +62,7 @@ schema.pre('init', function ensureSummaryIsFetched (chal) {
|
||||
});
|
||||
|
||||
// A list of additional fields that cannot be updated (but can be set on creation)
|
||||
let noUpdate = ['group', 'official', 'shortName', 'prize'];
|
||||
let noUpdate = ['group', 'leader', 'official', 'shortName', 'prize'];
|
||||
schema.statics.sanitizeUpdate = function sanitizeUpdate (updateObj) {
|
||||
return this.sanitize(updateObj, noUpdate);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user