summaryrefslogtreecommitdiffstats
path: root/web/react/utils/client.jsx
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-07-27 11:30:03 -0400
committerJoramWilander <jwawilander@gmail.com>2015-08-11 12:09:54 -0400
commit1c0ee4d2f65d1d4434a3a16070abe7d61a268ce6 (patch)
treea10ebb3fb82ad16c015276b0618c1beda18755ff /web/react/utils/client.jsx
parent4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e (diff)
downloadchat-1c0ee4d2f65d1d4434a3a16070abe7d61a268ce6.tar.gz
chat-1c0ee4d2f65d1d4434a3a16070abe7d61a268ce6.tar.bz2
chat-1c0ee4d2f65d1d4434a3a16070abe7d61a268ce6.zip
added getChannel api service and use that over getChannels where appropriate on client
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r--web/react/utils/client.jsx15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index 6a1f7c820..7b014cdad 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -554,6 +554,21 @@ module.exports.getChannels = function(success, error) {
});
};
+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) {
$.ajax({
url: "/api/v1/channels/more",