diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-11-23 10:01:45 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-11-23 10:01:45 -0500 |
commit | 4b3a3941e04803539f39c057a5c0d44cd30699be (patch) | |
tree | fb6324a5896da7123b76854e7eb504c239113824 /web/react/utils/client.jsx | |
parent | 5ee226d7f92d9408736b0e2a9ff105eb6f520a19 (diff) | |
parent | 9e8cd937908d5d2e730e94f761d6533eb2d95e28 (diff) | |
download | chat-4b3a3941e04803539f39c057a5c0d44cd30699be.tar.gz chat-4b3a3941e04803539f39c057a5c0d44cd30699be.tar.bz2 chat-4b3a3941e04803539f39c057a5c0d44cd30699be.zip |
Merge pull request #1475 from mattermost/plt-90
PLT-90 PLT-88 PLT-1109 PLT-1167 Implementing Permalinks, Jump to post from search, Performace Improvements.
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r-- | web/react/utils/client.jsx | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index e6c24aa9c..09e962161 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -820,7 +820,37 @@ export function getPosts(channelId, since, success, error, complete) { }); } -export function getPost(channelId, postId, success, error) { +export function getPostsBefore(channelId, post, offset, numPost, success, error, complete) { + $.ajax({ + url: '/api/v1/channels/' + channelId + '/post/' + post + '/before/' + offset + '/' + numPost, + dataType: 'json', + type: 'GET', + ifModified: false, + success, + error: function onError(xhr, status, err) { + var e = handleError('getPostsBefore', xhr, status, err); + error(e); + }, + complete: complete + }); +} + +export function getPostsAfter(channelId, post, offset, numPost, success, error, complete) { + $.ajax({ + url: '/api/v1/channels/' + channelId + '/post/' + post + '/after/' + offset + '/' + numPost, + dataType: 'json', + type: 'GET', + ifModified: false, + success, + error: function onError(xhr, status, err) { + var e = handleError('getPostsAfter', xhr, status, err); + error(e); + }, + complete: complete + }); +} + +export function getPost(channelId, postId, success, error, complete) { $.ajax({ cache: false, url: '/api/v1/channels/' + channelId + '/post/' + postId, @@ -831,7 +861,24 @@ export function getPost(channelId, postId, success, error) { error: function onError(xhr, status, err) { var e = handleError('getPost', xhr, status, err); error(e); - } + }, + complete + }); +} + +export function getPostById(postId, success, error, complete) { + $.ajax({ + cache: false, + url: '/api/v1/posts/' + postId, + dataType: 'json', + type: 'GET', + ifModified: false, + success, + error: function onError(xhr, status, err) { + var e = handleError('getPostById', xhr, status, err); + error(e); + }, + complete }); } |