From 6297922ab9561dbf774ab5d51619abfc4a411e40 Mon Sep 17 00:00:00 2001
From: Brian Olecki <bolecki019@gmail.com>
Date: Tue, 15 Nov 2016 10:43:16 -0500
Subject: Add support for editing slash commands (#4335)

---
 webapp/utils/async_client.jsx | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

(limited to 'webapp/utils/async_client.jsx')

diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index efa9eeb2b..fe31d4ef8 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -1348,6 +1348,29 @@ export function addCommand(command, success, error) {
     );
 }
 
+export function editCommand(command, success, error) {
+    Client.editCommand(
+        command,
+        (data) => {
+            AppDispatcher.handleServerAction({
+                type: ActionTypes.RECEIVED_COMMAND,
+                command: data
+            });
+
+            if (success) {
+                success(data);
+            }
+        },
+        (err) => {
+            if (error) {
+                error(err);
+            } else {
+                dispatchError(err, 'editCommand');
+            }
+        }
+    );
+}
+
 export function deleteCommand(id) {
     Client.deleteCommand(
         id,
-- 
cgit v1.2.3-1-g7c22

