diff options
author | Gabin Aureche <gabin.aureche@live.fr> | 2017-03-13 13:25:08 +0100 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-03-13 12:25:08 +0000 |
commit | fe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81 (patch) | |
tree | b96d457cde64b7397f91028106e93a7f92a179bd /webapp/client/client.jsx | |
parent | 482a0fb5fc248b1ec61db35299dc3e6d963ad5ab (diff) | |
download | chat-fe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81.tar.gz chat-fe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81.tar.bz2 chat-fe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81.zip |
Add pinned posts (#4217)
Diffstat (limited to 'webapp/client/client.jsx')
-rw-r--r-- | webapp/client/client.jsx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx index eaffd9ff4..a95049f93 100644 --- a/webapp/client/client.jsx +++ b/webapp/client/client.jsx @@ -1802,6 +1802,15 @@ export default class Client { this.trackEvent('api', 'api_posts_get_flagged', {team_id: this.getTeamId()}); } + getPinnedPosts(channelId, success, error) { + request. + get(`${this.getChannelNeededRoute(channelId)}/pinned`). + set(this.defaultHeaders). + type('application/json'). + accept('application/json'). + end(this.handleResponse.bind(this, 'getPinnedPosts', success, error)); + } + getFileInfosForPost(channelId, postId, success, error) { request. get(`${this.getChannelNeededRoute(channelId)}/posts/${postId}/get_file_infos`). @@ -2187,6 +2196,24 @@ export default class Client { }); } + pinPost(channelId, postId, success, error) { + request. + post(`${this.getChannelNeededRoute(channelId)}/posts/${postId}/pin`). + set(this.defaultHeaders). + accept('application/json'). + send(). + end(this.handleResponse.bind(this, 'pinPost', success, error)); + } + + unpinPost(channelId, postId, success, error) { + request. + post(`${this.getChannelNeededRoute(channelId)}/posts/${postId}/unpin`). + set(this.defaultHeaders). + accept('application/json'). + send(). + end(this.handleResponse.bind(this, 'unpinPost', success, error)); + } + saveReaction(channelId, reaction, success, error) { request. post(`${this.getChannelNeededRoute(channelId)}/posts/${reaction.post_id}/reactions/save`). |