diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-17 10:30:49 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-29 15:18:26 -0400 |
commit | c417fdc152e953982d9c9af2c04ca2c04ced41b3 (patch) | |
tree | 6bf1f8618474d3e60bbe844876de665407f80095 /webapp/utils/async_client.jsx | |
parent | 9c36210edd7cae4026e3a2ee472cf2fa751a0f77 (diff) | |
download | chat-c417fdc152e953982d9c9af2c04ca2c04ced41b3.tar.gz chat-c417fdc152e953982d9c9af2c04ca2c04ced41b3.tar.bz2 chat-c417fdc152e953982d9c9af2c04ca2c04ced41b3.zip |
Added initial backstage components and InstalledIntegrations page
Diffstat (limited to 'webapp/utils/async_client.jsx')
-rw-r--r-- | webapp/utils/async_client.jsx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index 6140fd9e0..2154fbe43 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -1121,3 +1121,49 @@ export function getRecentAndNewUsersAnalytics(teamId) { } ); } + +export function listIncomingHooks() { + if (isCallInProgress('listIncomingHooks')) { + return; + } + + callTracker.listIncomingHooks = utils.getTimestamp(); + + client.listIncomingHooks( + (data) => { + callTracker.listIncomingHooks = 0; + + AppDispatcher.handleServerAction({ + type: ActionTypes.RECEIVED_INCOMING_WEBHOOKS, + incomingWebhooks: data + }); + }, + (err) => { + callTracker.listIncomingHooks = 0; + dispatchError(err, 'getIncomingHooks'); + } + ); +} + +export function listOutgoingHooks() { + if (isCallInProgress('listOutgoingHooks')) { + return; + } + + callTracker.listOutgoingHooks = utils.getTimestamp(); + + client.listOutgoingHooks( + (data) => { + callTracker.listOutgoingHooks = 0; + + AppDispatcher.handleServerAction({ + type: ActionTypes.RECEIVED_OUTGOING_WEBHOOKS, + outgoingWebhooks: data + }); + }, + (err) => { + callTracker.listOutgoingHooks = 0; + dispatchError(err, 'getOutgoingHooks'); + } + ); +} |