summaryrefslogtreecommitdiffstats
path: root/web/react/utils/client.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-27 11:22:19 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-27 11:22:19 -0400
commite1c09605dce8441e1523abc4c830062fdd457337 (patch)
treefab3563d01c1194e8dd3d873aeb37d7dd55f3b81 /web/react/utils/client.jsx
parentea4beb7c4545e3ad6c7214a6a15ec66cc784f5ea (diff)
parent041d89b85a22b0a498a4176d0d26fd5dc84c33f9 (diff)
downloadchat-e1c09605dce8441e1523abc4c830062fdd457337.tar.gz
chat-e1c09605dce8441e1523abc4c830062fdd457337.tar.bz2
chat-e1c09605dce8441e1523abc4c830062fdd457337.zip
Merge pull request #469 from mattermost/mm-1699
MM-1699 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.jsx17
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,