Move instances of Client.updateUserNotifyProps() in components to an action (#5156)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
9b0ac63133
Коммит
efbaa1eb03
@@ -453,6 +453,24 @@ export function generateMfaSecret(success, error) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateUserNotifyProps(data, success, error) {
|
||||||
|
Client.updateUserNotifyProps(
|
||||||
|
data,
|
||||||
|
() => {
|
||||||
|
AsyncClient.getMe();
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
success();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
if (error) {
|
||||||
|
error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function updateUserRoles(userId, newRoles, success, error) {
|
export function updateUserRoles(userId, newRoles, success, error) {
|
||||||
Client.updateUserRoles(
|
Client.updateUserRoles(
|
||||||
userId,
|
userId,
|
||||||
|
|||||||
@@ -8,10 +8,9 @@ import DesktopNotificationSettings from './desktop_notification_settings.jsx';
|
|||||||
|
|
||||||
import UserStore from 'stores/user_store.jsx';
|
import UserStore from 'stores/user_store.jsx';
|
||||||
|
|
||||||
import Client from 'client/web_client.jsx';
|
|
||||||
import * as AsyncClient from 'utils/async_client.jsx';
|
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
|
import {updateUserNotifyProps} from 'actions/user_actions.jsx';
|
||||||
|
|
||||||
import EmailNotificationSetting from './email_notification_setting.jsx';
|
import EmailNotificationSetting from './email_notification_setting.jsx';
|
||||||
import {FormattedMessage} from 'react-intl';
|
import {FormattedMessage} from 'react-intl';
|
||||||
@@ -143,10 +142,10 @@ export default class NotificationsTab extends React.Component {
|
|||||||
data.first_name = this.state.firstNameKey.toString();
|
data.first_name = this.state.firstNameKey.toString();
|
||||||
data.channel = this.state.channelKey.toString();
|
data.channel = this.state.channelKey.toString();
|
||||||
|
|
||||||
Client.updateUserNotifyProps(data,
|
updateUserNotifyProps(
|
||||||
|
data,
|
||||||
() => {
|
() => {
|
||||||
this.props.updateSection('');
|
this.props.updateSection('');
|
||||||
AsyncClient.getMe();
|
|
||||||
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
|
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user