From 3db03017c8e1f9ba54e0c9cc7f6fc9d087d4b6f8 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 28 Jun 2017 09:51:09 -0300 Subject: [PATCH] Fix user's customFields not being saved --- packages/rocketchat-lib/server/models/Users.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-lib/server/models/Users.js b/packages/rocketchat-lib/server/models/Users.js index ec3d6ad5036f..00513f5adc96 100644 --- a/packages/rocketchat-lib/server/models/Users.js +++ b/packages/rocketchat-lib/server/models/Users.js @@ -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};