From 1c0ee4d2f65d1d4434a3a16070abe7d61a268ce6 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 27 Jul 2015 11:30:03 -0400 Subject: added getChannel api service and use that over getChannels where appropriate on client --- web/react/utils/client.jsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'web/react/utils/client.jsx') 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", -- cgit v1.2.3-1-g7c22