summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-03-29 10:04:53 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-03-29 15:18:48 -0400
commit149c72cf8c136781864863bf71ae3bf0d516728d (patch)
treefd128e9ce31f2f2c2afd6657478e91cb92a6fade /webapp/utils
parentfcd8f2e2badc0d314eaba2f1e0360274e0ba9e24 (diff)
downloadchat-149c72cf8c136781864863bf71ae3bf0d516728d.tar.gz
chat-149c72cf8c136781864863bf71ae3bf0d516728d.tar.bz2
chat-149c72cf8c136781864863bf71ae3bf0d516728d.zip
Added ability to regenerate outgoing webhook tokens on InstalledIntegrations page
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx15
-rw-r--r--webapp/utils/constants.jsx1
2 files changed, 16 insertions, 0 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index 93eeee351..cc19baa7e 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -1243,3 +1243,18 @@ export function deleteOutgoingHook(id) {
}
);
}
+
+export function regenOutgoingHookToken(id) {
+ client.regenOutgoingHookToken(
+ {id},
+ (data) => {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.UPDATED_OUTGOING_WEBHOOK,
+ outgoingWebhook: data
+ });
+ },
+ (err) => {
+ dispatchError(err, 'regenOutgoingHookToken');
+ }
+ );
+}
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index 89bf4e865..c7f61e9df 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -74,6 +74,7 @@ export default {
REMOVED_INCOMING_WEBHOOK: null,
RECEIVED_OUTGOING_WEBHOOKS: null,
RECEIVED_OUTGOING_WEBHOOK: null,
+ UPDATED_OUTGOING_WEBHOOK: null,
REMOVED_OUTGOING_WEBHOOK: null,
RECEIVED_MSG: null,