summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorBjörn Roland <bjoernr-de@users.noreply.github.com>2016-12-22 14:46:13 +0100
committerenahum <nahumhbl@gmail.com>2016-12-22 10:46:13 -0300
commit84c6e376fab7de7d74c103a5dea49f331e827311 (patch)
treede331e2fae3a86a70c0498d00f3ead6503704e0a /webapp/actions
parent670234dc663ceee1bd8ff4701f5d85006cad4777 (diff)
downloadchat-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/actions')
-rw-r--r--webapp/actions/team_actions.jsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/webapp/actions/team_actions.jsx b/webapp/actions/team_actions.jsx
index 6a5cccb81..3a86bada9 100644
--- a/webapp/actions/team_actions.jsx
+++ b/webapp/actions/team_actions.jsx
@@ -75,3 +75,20 @@ export function removeUserFromTeam(teamId, userId, success, error) {
}
);
}
+
+export function updateTeamMemberRoles(teamId, userId, newRoles, success, error) {
+ Client.updateTeamMemberRoles(teamId, userId, newRoles,
+ () => {
+ AsyncClient.getTeamMember(teamId, userId);
+
+ if (success) {
+ success();
+ }
+ },
+ (err) => {
+ if (error) {
+ error(err);
+ }
+ }
+ );
+}