summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-08-08 13:45:17 +0100
committerJoram Wilander <jwawilander@gmail.com>2017-08-08 08:45:17 -0400
commit5132c62d15d6a590ba44085c8c93d5dbe9200dc6 (patch)
tree442a9fa4987a530a1b22f5660a832408c9575294 /webapp/actions
parent82407bd44aeac52c526b57c7c3ef5c8579760849 (diff)
downloadchat-5132c62d15d6a590ba44085c8c93d5dbe9200dc6.tar.gz
chat-5132c62d15d6a590ba44085c8c93d5dbe9200dc6.tar.bz2
chat-5132c62d15d6a590ba44085c8c93d5dbe9200dc6.zip
PLT-7309: Fix webook management when permitted for non-admins. (#7132)
Diffstat (limited to 'webapp/actions')
-rw-r--r--webapp/actions/integration_actions.jsx28
1 files changed, 28 insertions, 0 deletions
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++) {