diff options
Diffstat (limited to 'web/react/utils/async_client.jsx')
-rw-r--r-- | web/react/utils/async_client.jsx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx index fc8c23fd5..9383057c3 100644 --- a/web/react/utils/async_client.jsx +++ b/web/react/utils/async_client.jsx @@ -357,3 +357,25 @@ module.exports.getStatuses = function() { } ); } + +module.exports.getMyTeam = function() { + if (isCallInProgress("getMyTeam")) return; + + callTracker["getMyTeam"] = utils.getTimestamp(); + client.getMyTeam( + function(data, textStatus, xhr) { + callTracker["getMyTeam"] = 0; + + if (xhr.status === 304 || !data) return; + + AppDispatcher.handleServerAction({ + type: ActionTypes.RECIEVED_TEAM, + team: data + }); + }, + function(err) { + callTracker["getMyTeam"] = 0; + dispatchError(err, "getMyTeam"); + } + ); +} |