From ad52183248512b9aafa59b4429364c75e024cf6f Mon Sep 17 00:00:00 2001
From: Nick Frazier <nrflaw@gmail.com>
Date: Tue, 29 Nov 2016 09:10:02 -0500
Subject: Move instances of Client.updateUserRoles() in components to an action
 (#4657)

* moved updateUserRoles to user_actions

* updated second updateUserRoles call
---
 .../admin_console/admin_team_members_dropdown.jsx           | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

(limited to 'webapp/components/admin_console/admin_team_members_dropdown.jsx')

diff --git a/webapp/components/admin_console/admin_team_members_dropdown.jsx b/webapp/components/admin_console/admin_team_members_dropdown.jsx
index 0331e6c4e..028effe66 100644
--- a/webapp/components/admin_console/admin_team_members_dropdown.jsx
+++ b/webapp/components/admin_console/admin_team_members_dropdown.jsx
@@ -10,6 +10,7 @@ import Client from 'client/web_client.jsx';
 import Constants from 'utils/constants.jsx';
 import * as Utils from 'utils/utils.jsx';
 import * as AsyncClient from 'utils/async_client.jsx';
+import {updateUserRoles} from 'actions/user_actions.jsx';
 
 import {FormattedMessage} from 'react-intl';
 
@@ -42,12 +43,10 @@ export default class AdminTeamMembersDropdown extends React.Component {
     }
 
     doMakeMember() {
-        Client.updateUserRoles(
+        updateUserRoles(
             this.props.user.id,
             'system_user',
-            () => {
-                AsyncClient.getUser(this.props.user.id);
-            },
+            null,
             (err) => {
                 this.setState({serverError: err.message});
             }
@@ -142,12 +141,10 @@ export default class AdminTeamMembersDropdown extends React.Component {
     handleMakeSystemAdmin(e) {
         e.preventDefault();
 
-        Client.updateUserRoles(
+        updateUserRoles(
             this.props.user.id,
             'system_user system_admin',
-            () => {
-                AsyncClient.getUser(this.props.user.id);
-            },
+            null,
             (err) => {
                 this.setState({serverError: err.message});
             }
-- 
cgit v1.2.3-1-g7c22

