summaryrefslogtreecommitdiffstats
path: root/webapp/actions/user_actions.jsx
diff options
context:
space:
mode:
authorNick Frazier <nrflaw@gmail.com>2016-11-29 09:10:02 -0500
committerJoram Wilander <jwawilander@gmail.com>2016-11-29 09:10:02 -0500
commitad52183248512b9aafa59b4429364c75e024cf6f (patch)
tree94611694cbf953e8992edaa57c700f4c15f94e5b /webapp/actions/user_actions.jsx
parentccf05bfdfec0bf83edbfbdcb41179a1babea2631 (diff)
downloadchat-ad52183248512b9aafa59b4429364c75e024cf6f.tar.gz
chat-ad52183248512b9aafa59b4429364c75e024cf6f.tar.bz2
chat-ad52183248512b9aafa59b4429364c75e024cf6f.zip
Move instances of Client.updateUserRoles() in components to an action (#4657)
* moved updateUserRoles to user_actions * updated second updateUserRoles call
Diffstat (limited to 'webapp/actions/user_actions.jsx')
-rw-r--r--webapp/actions/user_actions.jsx19
1 files changed, 19 insertions, 0 deletions
diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx
index fefca79f7..ce2246d30 100644
--- a/webapp/actions/user_actions.jsx
+++ b/webapp/actions/user_actions.jsx
@@ -352,3 +352,22 @@ export function generateMfaSecret(success, error) {
}
);
}
+
+export function updateUserRoles(userId, newRoles, success, error) {
+ Client.updateUserRoles(
+ userId,
+ newRoles,
+ () => {
+ AsyncClient.getUser(this.props.user.id);
+
+ if (success) {
+ success();
+ }
+ },
+ (err) => {
+ if (error) {
+ error(err);
+ }
+ }
+ );
+}