diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-08-26 12:09:01 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-08-27 08:21:26 -0400 |
commit | 041d89b85a22b0a498a4176d0d26fd5dc84c33f9 (patch) | |
tree | 37cc2ca9252b45f6f30ba4e88037a67a700ec0ad /web/react/utils/client.jsx | |
parent | 8356e25f80bbba3040ceeda5732b8843b8e493c1 (diff) | |
download | chat-041d89b85a22b0a498a4176d0d26fd5dc84c33f9.tar.gz chat-041d89b85a22b0a498a4176d0d26fd5dc84c33f9.tar.bz2 chat-041d89b85a22b0a498a4176d0d26fd5dc84c33f9.zip |
Refactored post handling/updating on both the client and server.
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r-- | web/react/utils/client.jsx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index 13d6c3f54..70220c71e 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -653,7 +653,7 @@ module.exports.executeCommand = function(channelId, command, suggest, success, e }); }; -module.exports.getPosts = function(channelId, offset, limit, success, error, complete) { +module.exports.getPostsPage = function(channelId, offset, limit, success, error, complete) { $.ajax({ cache: false, url: '/api/v1/channels/' + channelId + '/posts/' + offset + '/' + limit, @@ -669,6 +669,21 @@ module.exports.getPosts = function(channelId, offset, limit, success, error, com }); }; +module.exports.getPosts = function(channelId, since, success, error, complete) { + $.ajax({ + url: '/api/v1/channels/' + channelId + '/posts/' + since, + dataType: 'json', + type: 'GET', + ifModified: true, + success: success, + error: function onError(xhr, status, err) { + var e = handleError('getPosts', xhr, status, err); + error(e); + }, + complete: complete + }); +}; + module.exports.getPost = function(channelId, postId, success, error) { $.ajax({ cache: false, |