diff options
author | Corey Hulen <corey@hulen.com> | 2015-08-18 21:19:15 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-08-18 21:19:15 -0700 |
commit | 5bf1aac6970166a565bee74c24aeba551940991c (patch) | |
tree | 13590cfa2eea5dd95970458b377256d82e05a9a1 /web/react/utils/client.jsx | |
parent | 44464f8f3c99ea4bae744a45e2924330a72f9b17 (diff) | |
parent | f2b06cfc7c847f687582b1855959fdd885e3fac8 (diff) | |
download | chat-5bf1aac6970166a565bee74c24aeba551940991c.tar.gz chat-5bf1aac6970166a565bee74c24aeba551940991c.tar.bz2 chat-5bf1aac6970166a565bee74c24aeba551940991c.zip |
Merge pull request #383 from rgarmsen2295/mm-1584b
MM-1584 Private message channels no longer do a page refresh on creation/first use
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r-- | web/react/utils/client.jsx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index ce044457a..da0b74081 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -438,6 +438,23 @@ module.exports.createChannel = function(channel, success, error) { module.exports.track('api', 'api_channels_create', channel.type, 'name', channel.name); }; +module.exports.createDirectChannel = function(channel, userId, success, error) { + $.ajax({ + url: '/api/v1/channels/create_direct', + dataType: 'json', + contentType: 'application/json', + type: 'POST', + data: JSON.stringify({user_id: userId}), + success: success, + error: function(xhr, status, err) { + var e = handleError('createDirectChannel', xhr, status, err); + error(e); + } + }); + + module.exports.track('api', 'api_channels_create_direct', channel.type, 'name', channel.name); +}; + module.exports.updateChannel = function(channel, success, error) { $.ajax({ url: "/api/v1/channels/update", |