Skip to content

Commit

Permalink
Merge pull request #7617 from RocketChat/fix-custom-fields
Browse files Browse the repository at this point in the history
[FIX] Fix Custom Fields Crashing on Register
  • Loading branch information
rodrigok authored Jul 31, 2017
2 parents 7ee603b + edbf3a4 commit 9930c25
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ RocketChat.saveCustomFieldsWithoutValidation = function(userId, formData) {
throw new Meteor.Error('error-invalid-customfield-json', 'Invalid JSON for Custom Fields');
}

const customFields = formData;

// for fieldName, field of customFieldsMeta
const customFields = {};
Object.keys(customFieldsMeta).forEach(key => customFields[key] = formData[key]);
RocketChat.models.Users.setCustomFields(userId, customFields);

Object.keys(customFields).forEach((fieldName) => {
Expand Down

0 comments on commit 9930c25

Please sign in to comment.