From f0f53260984a210f44458d86ed5ac9e3afb3f363 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Roland?= <bjoernr-de@users.noreply.github.com>
Date: Wed, 21 Dec 2016 18:48:06 +0100
Subject: #4698 Move Client.updateActive() in components to an action (#4858)

* #4698 Move instances of Client.updateActive() in components to an action

* Use null for empty success function
---
 webapp/actions/user_actions.jsx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'webapp/actions/user_actions.jsx')

diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx
index 812bc2716..b666413d9 100644
--- a/webapp/actions/user_actions.jsx
+++ b/webapp/actions/user_actions.jsx
@@ -432,3 +432,20 @@ export function checkMfa(loginId, success, error) {
         }
     );
 }
+
+export function updateActive(userId, active, success, error) {
+    Client.updateActive(userId, active,
+        () => {
+            AsyncClient.getUser(userId);
+
+            if (success) {
+                success();
+            }
+        },
+        (err) => {
+            if (error) {
+                error(err);
+            }
+        }
+    );
+}
-- 
cgit v1.2.3-1-g7c22

