From 149c72cf8c136781864863bf71ae3bf0d516728d Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 29 Mar 2016 10:04:53 -0400 Subject: Added ability to regenerate outgoing webhook tokens on InstalledIntegrations page --- webapp/utils/async_client.jsx | 15 +++++++++++++++ webapp/utils/constants.jsx | 1 + 2 files changed, 16 insertions(+) (limited to 'webapp/utils') 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, -- cgit v1.2.3-1-g7c22