[FIX] Profile update (#955)
This commit is contained in:
parent
56e94adfa7
commit
109a247c8d
|
@ -644,9 +644,9 @@ const RocketChat = {
|
||||||
// RC 0.55.0
|
// RC 0.55.0
|
||||||
return this.sdk.methodCall('saveRoomSettings', rid, params);
|
return this.sdk.methodCall('saveRoomSettings', rid, params);
|
||||||
},
|
},
|
||||||
saveUserProfile(data) {
|
saveUserProfile(data, customFields) {
|
||||||
// RC 0.62.2
|
// RC 0.62.2
|
||||||
return this.sdk.post('users.updateOwnBasicInfo', { data });
|
return this.sdk.post('users.updateOwnBasicInfo', { data, customFields });
|
||||||
},
|
},
|
||||||
saveUserPreferences(params) {
|
saveUserPreferences(params) {
|
||||||
// RC 0.51.0
|
// RC 0.51.0
|
||||||
|
|
|
@ -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 (result.success) {
|
||||||
if (params.customFields) {
|
if (customFields) {
|
||||||
setUser({ customFields });
|
setUser({ customFields, ...params });
|
||||||
|
} else {
|
||||||
|
setUser({ ...params });
|
||||||
}
|
}
|
||||||
this.setState({ saving: false });
|
this.setState({ saving: false });
|
||||||
this.toast.show(I18n.t('Profile_saved_successfully'));
|
this.toast.show(I18n.t('Profile_saved_successfully'));
|
||||||
|
|
Loading…
Reference in New Issue