summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2016-11-17 15:25:11 +0100
committerenahum <nahumhbl@gmail.com>2016-11-17 11:25:11 -0300
commit091e5b8e03d6e0f107a0f70e1d918b753c52ae20 (patch)
treee82e3669ffc37f3d53905669a8125144bbcd9c9f /webapp/actions
parentbe74ec22414a9a34f458a0fb30ea14e2d02dcd3f (diff)
downloadchat-091e5b8e03d6e0f107a0f70e1d918b753c52ae20.tar.gz
chat-091e5b8e03d6e0f107a0f70e1d918b753c52ae20.tar.bz2
chat-091e5b8e03d6e0f107a0f70e1d918b753c52ae20.zip
PLT-4572 - Move instances of Client.updateUser() in components to an action (#4571)
* Move instances of Client.updateUser() in components to an action
Diffstat (limited to 'webapp/actions')
-rw-r--r--webapp/actions/user_actions.jsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx
index 304d36a62..5d07bed14 100644
--- a/webapp/actions/user_actions.jsx
+++ b/webapp/actions/user_actions.jsx
@@ -317,6 +317,24 @@ export function autocompleteUsersInTeam(username, success, error) {
);
}
+export function updateUser(username, success, error) {
+ Client.updateUser(
+ username,
+ (data) => {
+ if (success) {
+ success(data);
+ }
+ },
+ (err) => {
+ AsyncClient.dispatchError(err, 'updateUser');
+
+ if (error) {
+ error(err);
+ }
+ }
+ );
+}
+
export function generateMfaSecret(success, error) {
Client.generateMfaSecret(
(data) => {