summaryrefslogtreecommitdiffstats
path: root/webapp/utils/async_client.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils/async_client.jsx')
-rw-r--r--webapp/utils/async_client.jsx34
1 files changed, 34 insertions, 0 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index e1449e3c5..f4faba934 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -1607,6 +1607,40 @@ export function deleteEmoji(id) {
);
}
+export function pinPost(channelId, reaction) {
+ Client.pinPost(
+ channelId,
+ reaction,
+ () => {
+ // the "post_edited" websocket event take cares of updating the posts
+ // the action below is mostly dispatched for the RHS to update
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECEIVED_POST_PINNED
+ });
+ },
+ (err) => {
+ dispatchError(err, 'pinPost');
+ }
+ );
+}
+
+export function unpinPost(channelId, reaction) {
+ Client.unpinPost(
+ channelId,
+ reaction,
+ () => {
+ // the "post_edited" websocket event take cares of updating the posts
+ // the action below is mostly dispatched for the RHS to update
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECEIVED_POST_UNPINNED
+ });
+ },
+ (err) => {
+ dispatchError(err, 'unpinPost');
+ }
+ );
+}
+
export function saveReaction(channelId, reaction) {
Client.saveReaction(
channelId,