Skip to content

Commit

Permalink
Fix user's customFields not being saved
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Jun 28, 2017
1 parent b23eb6f commit 3db0301
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/rocketchat-lib/server/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,8 @@ class ModelUsers extends RocketChat.models._Base {

setCustomFields(_id, fields) {
const values = {};
Object.keys(fields).reduce(key => {
const value = fields[key];
values[`customFields.${ key }`] = value;
Object.keys(fields).forEach(key => {
values[`customFields.${ key }`] = fields[key];
});

const update = {$set: values};
Expand Down

0 comments on commit 3db0301

Please sign in to comment.