summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx30
-rw-r--r--webapp/utils/constants.jsx3
2 files changed, 33 insertions, 0 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index 9ca2bd606..93eeee351 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -1213,3 +1213,33 @@ export function addOutgoingHook(hook, success, error) {
}
);
}
+
+export function deleteIncomingHook(id) {
+ client.deleteIncomingHook(
+ {id},
+ () => {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.REMOVED_INCOMING_WEBHOOK,
+ id
+ });
+ },
+ (err) => {
+ dispatchError(err, 'deleteIncomingHook');
+ }
+ );
+}
+
+export function deleteOutgoingHook(id) {
+ client.deleteOutgoingHook(
+ {id},
+ () => {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.REMOVED_OUTGOING_WEBHOOK,
+ id
+ });
+ },
+ (err) => {
+ dispatchError(err, 'deleteOutgoingHook');
+ }
+ );
+}
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index 126324de8..89bf4e865 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -68,10 +68,13 @@ export default {
RECEIVED_PREFERENCE: null,
RECEIVED_PREFERENCES: null,
RECEIVED_FILE_INFO: null,
+
RECEIVED_INCOMING_WEBHOOKS: null,
RECEIVED_INCOMING_WEBHOOK: null,
+ REMOVED_INCOMING_WEBHOOK: null,
RECEIVED_OUTGOING_WEBHOOKS: null,
RECEIVED_OUTGOING_WEBHOOK: null,
+ REMOVED_OUTGOING_WEBHOOK: null,
RECEIVED_MSG: null,