Move instances of Client.getInviteInfo() in components to an action (#5130)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
23e7414d35
Коммит
6aec2b6c55
@@ -110,3 +110,19 @@ export function addUserToTeamFromInvite(data, hash, inviteId, success, error) {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function getInviteInfo(inviteId, success, error) {
|
||||
Client.getInviteInfo(
|
||||
inviteId,
|
||||
(inviteData) => {
|
||||
if (success) {
|
||||
success(inviteData);
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
if (error) {
|
||||
error(err);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import LoadingScreen from 'components/loading_screen.jsx';
|
||||
|
||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||
import {track} from 'actions/analytics_actions.jsx';
|
||||
import {getInviteInfo} from 'actions/team_actions.jsx';
|
||||
|
||||
import BrowserStore from 'stores/browser_store.jsx';
|
||||
|
||||
@@ -58,7 +59,7 @@ export default class SignupEmail extends React.Component {
|
||||
loading = false;
|
||||
} else if (inviteId && inviteId.length > 0) {
|
||||
loading = true;
|
||||
Client.getInviteInfo(
|
||||
getInviteInfo(
|
||||
inviteId,
|
||||
(inviteData) => {
|
||||
if (!inviteData) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import BrowserStore from 'stores/browser_store.jsx';
|
||||
import * as AsyncClient from 'utils/async_client.jsx';
|
||||
import Client from 'client/web_client.jsx';
|
||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||
import {addUserToTeamFromInvite} from 'actions/team_actions.jsx';
|
||||
import {addUserToTeamFromInvite, getInviteInfo} from 'actions/team_actions.jsx';
|
||||
|
||||
import logoImage from 'images/logo.png';
|
||||
import ErrorBar from 'components/error_bar.jsx';
|
||||
@@ -98,7 +98,7 @@ export default class SignupController extends React.Component {
|
||||
}
|
||||
|
||||
if (inviteId) {
|
||||
Client.getInviteInfo(
|
||||
getInviteInfo(
|
||||
inviteId,
|
||||
(inviteData) => {
|
||||
if (!inviteData) {
|
||||
|
||||
Ссылка в новой задаче
Block a user