mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Fix: Updated challenge.js to allow shortName to be editable by party leader (#13654)
* updated challenge.js to allow shortName to be editable * fix api-v3 integration test error
This commit is contained in:
@@ -74,7 +74,6 @@ describe('PUT /challenges/:challengeId', () => {
|
|||||||
expect(res.memberCount).to.equal(2);
|
expect(res.memberCount).to.equal(2);
|
||||||
expect(res.tasksOrder).not.to.equal('new order');
|
expect(res.tasksOrder).not.to.equal('new order');
|
||||||
expect(res.official).to.equal(false);
|
expect(res.official).to.equal(false);
|
||||||
expect(res.shortName).not.to.equal('new short name');
|
|
||||||
|
|
||||||
expect(res.leader).to.eql({
|
expect(res.leader).to.eql({
|
||||||
_id: user._id,
|
_id: user._id,
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ schema.pre('init', chal => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// A list of additional fields that cannot be updated (but can be set on creation)
|
// A list of additional fields that cannot be updated (but can be set on creation)
|
||||||
const noUpdate = ['group', 'leader', 'official', 'shortName', 'prize'];
|
const noUpdate = ['group', 'leader', 'official', 'prize'];
|
||||||
schema.statics.sanitizeUpdate = function sanitizeUpdate (updateObj) {
|
schema.statics.sanitizeUpdate = function sanitizeUpdate (updateObj) {
|
||||||
return this.sanitize(updateObj, noUpdate);
|
return this.sanitize(updateObj, noUpdate);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user