summaryrefslogtreecommitdiffstats
path: root/app/reaction.go
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-04-11 22:14:33 +0900
committerGeorge Goldberg <george@gberg.me>2017-04-11 14:14:33 +0100
commite841d0c5023640efc3dcf9d5284f55458e06a0a6 (patch)
treeb78e475ffd4760e1c8aed16dd0ab3fbb7fa6e571 /app/reaction.go
parentd2be3de2d3b54c80f3499359dbd32306ccabd722 (diff)
downloadchat-e841d0c5023640efc3dcf9d5284f55458e06a0a6.tar.gz
chat-e841d0c5023640efc3dcf9d5284f55458e06a0a6.tar.bz2
chat-e841d0c5023640efc3dcf9d5284f55458e06a0a6.zip
APIv4 GET /posts/{post_id}/reactions (#6047)
Diffstat (limited to 'app/reaction.go')
-rw-r--r--app/reaction.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/reaction.go b/app/reaction.go
new file mode 100644
index 000000000..4f299a993
--- /dev/null
+++ b/app/reaction.go
@@ -0,0 +1,16 @@
+// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package app
+
+import (
+ "github.com/mattermost/platform/model"
+)
+
+func GetReactionsForPost(postId string) ([]*model.Reaction, *model.AppError) {
+ if result := <-Srv.Store.Reaction().GetForPost(postId, true); result.Err != nil {
+ return nil, result.Err
+ } else {
+ return result.Data.([]*model.Reaction), nil
+ }
+}