summaryrefslogtreecommitdiffstats
path: root/web/react/utils/client.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-14 08:35:19 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-14 08:35:19 -0400
commita8930cbabec21635a10e8cac4d2c0c79867f283d (patch)
treea622f8d94fa1b60753896640c1f8c1a5ebaf48e2 /web/react/utils/client.jsx
parentb1d37e9c385f0d3e9bddd9dffe1570574dcdcab6 (diff)
parent2485b87b28a7fed1996d627b48dcd94f19002fc8 (diff)
downloadchat-a8930cbabec21635a10e8cac4d2c0c79867f283d.tar.gz
chat-a8930cbabec21635a10e8cac4d2c0c79867f283d.tar.bz2
chat-a8930cbabec21635a10e8cac4d2c0c79867f283d.zip
Merge pull request #365 from mattermost/mm-1700
MM-1700 don't pull all channel data all the time
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r--web/react/utils/client.jsx37
1 files changed, 34 insertions, 3 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index 6a1f7c820..f2b6619a5 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -540,18 +540,34 @@ module.exports.updateLastViewedAt = function(channelId, success, error) {
});
};
-module.exports.getChannels = function(success, error) {
+function getChannels(success, error) {
$.ajax({
- url: "/api/v1/channels/",
+ url: '/api/v1/channels/',
dataType: 'json',
type: 'GET',
success: success,
ifModified: true,
error: function(xhr, status, err) {
- e = handleError("getChannels", xhr, status, err);
+ var e = handleError('getChannels', xhr, status, err);
error(e);
}
});
+}
+module.exports.getChannels = getChannels;
+
+module.exports.getChannel = function(id, success, error) {
+ $.ajax({
+ url: "/api/v1/channels/" + id + "/",
+ dataType: 'json',
+ type: 'GET',
+ success: success,
+ error: function(xhr, status, err) {
+ e = handleError("getChannel", xhr, status, err);
+ error(e);
+ }
+ });
+
+ module.exports.track('api', 'api_channel_get');
};
module.exports.getMoreChannels = function(success, error) {
@@ -568,6 +584,21 @@ module.exports.getMoreChannels = function(success, error) {
});
};
+function getChannelCounts(success, error) {
+ $.ajax({
+ url: '/api/v1/channels/counts',
+ dataType: 'json',
+ type: 'GET',
+ success: success,
+ ifModified: true,
+ error: function(xhr, status, err) {
+ var e = handleError('getChannelCounts', xhr, status, err);
+ error(e);
+ }
+ });
+}
+module.exports.getChannelCounts = getChannelCounts;
+
module.exports.getChannelExtraInfo = function(id, success, error) {
$.ajax({
url: "/api/v1/channels/" + id + "/extra_info",