Move instances of Client.inviteMembers() in components to an action (#5154)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
efbaa1eb03
Коммит
784d85f46d
@@ -126,3 +126,19 @@ export function getInviteInfo(inviteId, success, error) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function inviteMembers(data, success, error) {
|
||||||
|
Client.inviteMembers(
|
||||||
|
data,
|
||||||
|
() => {
|
||||||
|
if (success) {
|
||||||
|
success();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
if (err) {
|
||||||
|
error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import ReactDOM from 'react-dom';
|
|||||||
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';
|
||||||
const ActionTypes = Constants.ActionTypes;
|
const ActionTypes = Constants.ActionTypes;
|
||||||
import Client from 'client/web_client.jsx';
|
|
||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||||
import ModalStore from 'stores/modal_store.jsx';
|
import ModalStore from 'stores/modal_store.jsx';
|
||||||
import UserStore from 'stores/user_store.jsx';
|
import UserStore from 'stores/user_store.jsx';
|
||||||
import ChannelStore from 'stores/channel_store.jsx';
|
import ChannelStore from 'stores/channel_store.jsx';
|
||||||
import TeamStore from 'stores/team_store.jsx';
|
import TeamStore from 'stores/team_store.jsx';
|
||||||
import ConfirmModal from './confirm_modal.jsx';
|
import ConfirmModal from './confirm_modal.jsx';
|
||||||
|
import {inviteMembers} from 'actions/team_actions.jsx';
|
||||||
|
|
||||||
import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ class InviteMemberModal extends React.Component {
|
|||||||
|
|
||||||
this.setState({isSendingEmails: true});
|
this.setState({isSendingEmails: true});
|
||||||
|
|
||||||
Client.inviteMembers(
|
inviteMembers(
|
||||||
data,
|
data,
|
||||||
() => {
|
() => {
|
||||||
this.handleHide(false);
|
this.handleHide(false);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user