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:
Natalie L
2021-12-14 16:54:57 -05:00
committed by GitHub
parent a174b218bd
commit 9e0e805d35
2 changed files with 1 additions and 2 deletions

View File

@@ -74,7 +74,6 @@ describe('PUT /challenges/:challengeId', () => {
expect(res.memberCount).to.equal(2);
expect(res.tasksOrder).not.to.equal('new order');
expect(res.official).to.equal(false);
expect(res.shortName).not.to.equal('new short name');
expect(res.leader).to.eql({
_id: user._id,

View File

@@ -68,7 +68,7 @@ schema.pre('init', chal => {
});
// 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) {
return this.sanitize(updateObj, noUpdate);
};