[FIX] Profile update (#955)

This commit is contained in:
IlarionHalushka 2019-06-05 19:29:07 +03:00 committed by Diego Mello
parent 56e94adfa7
commit 109a247c8d
2 changed files with 7 additions and 6 deletions

View File

@ -644,9 +644,9 @@ const RocketChat = {
// RC 0.55.0
return this.sdk.methodCall('saveRoomSettings', rid, params);
},
saveUserProfile(data) {
saveUserProfile(data, customFields) {
// RC 0.62.2
return this.sdk.post('users.updateOwnBasicInfo', { data });
return this.sdk.post('users.updateOwnBasicInfo', { data, customFields });
},
saveUserPreferences(params) {
// RC 0.51.0

View File

@ -210,12 +210,13 @@ export default class ProfileView extends React.Component {
}
}
params.customFields = customFields;
const result = await RocketChat.saveUserProfile(params, customFields);
const result = await RocketChat.saveUserProfile(params);
if (result.success) {
if (params.customFields) {
setUser({ customFields });
if (customFields) {
setUser({ customFields, ...params });
} else {
setUser({ ...params });
}
this.setState({ saving: false });
this.toast.show(I18n.t('Profile_saved_successfully'));