diff options
author | Björn Roland <bjoernr-de@users.noreply.github.com> | 2016-12-22 14:46:13 +0100 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-12-22 10:46:13 -0300 |
commit | 84c6e376fab7de7d74c103a5dea49f331e827311 (patch) | |
tree | de331e2fae3a86a70c0498d00f3ead6503704e0a /webapp/components/admin_console | |
parent | 670234dc663ceee1bd8ff4701f5d85006cad4777 (diff) | |
download | chat-84c6e376fab7de7d74c103a5dea49f331e827311.tar.gz chat-84c6e376fab7de7d74c103a5dea49f331e827311.tar.bz2 chat-84c6e376fab7de7d74c103a5dea49f331e827311.zip |
#4695 Move instances of Client.updateTeamMemberRoles() in components to an action (#4870)
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r-- | webapp/components/admin_console/admin_team_members_dropdown.jsx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/webapp/components/admin_console/admin_team_members_dropdown.jsx b/webapp/components/admin_console/admin_team_members_dropdown.jsx index 4a42ded3a..0019dfbc0 100644 --- a/webapp/components/admin_console/admin_team_members_dropdown.jsx +++ b/webapp/components/admin_console/admin_team_members_dropdown.jsx @@ -11,6 +11,7 @@ import Constants from 'utils/constants.jsx'; import * as Utils from 'utils/utils.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import {updateUserRoles, updateActive} from 'actions/user_actions.jsx'; +import {updateTeamMemberRoles} from 'actions/team_actions.jsx'; import {FormattedMessage} from 'react-intl'; @@ -52,13 +53,11 @@ export default class AdminTeamMembersDropdown extends React.Component { } ); - Client.updateTeamMemberRoles( + updateTeamMemberRoles( this.props.teamMember.team_id, this.props.user.id, 'team_user', - () => { - AsyncClient.getTeamMember(this.props.teamMember.team_id, this.props.user.id); - }, + null, (err) => { this.setState({serverError: err.message}); } @@ -109,13 +108,11 @@ export default class AdminTeamMembersDropdown extends React.Component { } doMakeTeamAdmin() { - Client.updateTeamMemberRoles( + updateTeamMemberRoles( this.props.teamMember.team_id, this.props.user.id, 'team_user team_admin', - () => { - AsyncClient.getTeamMember(this.props.teamMember.team_id, this.props.user.id); - }, + null, (err) => { this.setState({serverError: err.message}); } |