summaryrefslogtreecommitdiffstats
path: root/web/react/utils/async_client.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-23 12:49:28 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-23 12:49:28 -0700
commit1626a6de6f16ba0878160b0a7eae9f49b8d34d4f (patch)
treeabc9088402a783c2e1908fb2db93ad84731827dd /web/react/utils/async_client.jsx
parent9e04909c0a3672d27c148c931d82b225cc86dfe5 (diff)
downloadchat-1626a6de6f16ba0878160b0a7eae9f49b8d34d4f.tar.gz
chat-1626a6de6f16ba0878160b0a7eae9f49b8d34d4f.tar.bz2
chat-1626a6de6f16ba0878160b0a7eae9f49b8d34d4f.zip
PLT-349 adding team mgt to admin console
Diffstat (limited to 'web/react/utils/async_client.jsx')
-rw-r--r--web/react/utils/async_client.jsx26
1 files changed, 26 insertions, 0 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index ed228f6c4..ab2965000 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -371,6 +371,32 @@ export function getConfig() {
);
}
+export function getAllTeams() {
+ if (isCallInProgress('getAllTeams')) {
+ return;
+ }
+
+ callTracker.getAllTeams = utils.getTimestamp();
+ client.getAllTeams(
+ (data, textStatus, xhr) => {
+ callTracker.getAllTeams = 0;
+
+ if (xhr.status === 304 || !data) {
+ return;
+ }
+
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECIEVED_ALL_TEAMS,
+ teams: data
+ });
+ },
+ (err) => {
+ callTracker.getAllTeams = 0;
+ dispatchError(err, 'getAllTeams');
+ }
+ );
+}
+
export function findTeams(email) {
if (isCallInProgress('findTeams_' + email)) {
return;