mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Move instances of Client.inviteMembers() in components to an action (#5154)
This commit is contained in:
committed by
George Goldberg
parent
efbaa1eb03
commit
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 Constants from 'utils/constants.jsx';
|
||||
const ActionTypes = Constants.ActionTypes;
|
||||
import Client from 'client/web_client.jsx';
|
||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||
import ModalStore from 'stores/modal_store.jsx';
|
||||
import UserStore from 'stores/user_store.jsx';
|
||||
import ChannelStore from 'stores/channel_store.jsx';
|
||||
import TeamStore from 'stores/team_store.jsx';
|
||||
import ConfirmModal from './confirm_modal.jsx';
|
||||
import {inviteMembers} from 'actions/team_actions.jsx';
|
||||
|
||||
import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
||||
|
||||
@@ -142,7 +142,7 @@ class InviteMemberModal extends React.Component {
|
||||
|
||||
this.setState({isSendingEmails: true});
|
||||
|
||||
Client.inviteMembers(
|
||||
inviteMembers(
|
||||
data,
|
||||
() => {
|
||||
this.handleHide(false);
|
||||
|
||||
Reference in New Issue
Block a user