From 5132c62d15d6a590ba44085c8c93d5dbe9200dc6 Mon Sep 17 00:00:00 2001
From: George Goldberg <george@gberg.me>
Date: Tue, 8 Aug 2017 13:45:17 +0100
Subject: PLT-7309: Fix webook management when permitted for non-admins.
 (#7132)

---
 webapp/actions/integration_actions.jsx | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

(limited to 'webapp/actions/integration_actions.jsx')

diff --git a/webapp/actions/integration_actions.jsx b/webapp/actions/integration_actions.jsx
index c9bba9202..cc20b3ab8 100644
--- a/webapp/actions/integration_actions.jsx
+++ b/webapp/actions/integration_actions.jsx
@@ -33,6 +33,20 @@ export function loadIncomingHooks(complete) {
     );
 }
 
+export function loadIncomingHooksForTeam(teamId, complete) {
+    IntegrationActions.getIncomingHooks(teamId, 0, 10000)(dispatch, getState).then(
+        (data) => {
+            if (data) {
+                loadProfilesForIncomingHooks(data);
+            }
+
+            if (complete) {
+                complete(data);
+            }
+        }
+    );
+}
+
 function loadProfilesForIncomingHooks(hooks) {
     const profilesToLoad = {};
     for (let i = 0; i < hooks.length; i++) {
@@ -64,6 +78,20 @@ export function loadOutgoingHooks(complete) {
     );
 }
 
+export function loadOutgoingHooksForTeam(teamId, complete) {
+    IntegrationActions.getOutgoingHooks('', teamId, 0, 10000)(dispatch, getState).then(
+        (data) => {
+            if (data) {
+                loadProfilesForOutgoingHooks(data);
+            }
+
+            if (complete) {
+                complete(data);
+            }
+        }
+    );
+}
+
 function loadProfilesForOutgoingHooks(hooks) {
     const profilesToLoad = {};
     for (let i = 0; i < hooks.length; i++) {
-- 
cgit v1.2.3-1-g7c22

