summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorBrian Olecki <bolecki019@gmail.com>2016-11-15 10:43:16 -0500
committerenahum <nahumhbl@gmail.com>2016-11-15 12:43:16 -0300
commit6297922ab9561dbf774ab5d51619abfc4a411e40 (patch)
tree84bbced4d8282f5e8af957164d6e92ae50238011 /webapp/utils
parent1f241af48a9554b6865d1ac79b4261341ab9b3f3 (diff)
downloadchat-6297922ab9561dbf774ab5d51619abfc4a411e40.tar.gz
chat-6297922ab9561dbf774ab5d51619abfc4a411e40.tar.bz2
chat-6297922ab9561dbf774ab5d51619abfc4a411e40.zip
Add support for editing slash commands (#4335)
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx23
1 files changed, 23 insertions, 0 deletions
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,