From e841d0c5023640efc3dcf9d5284f55458e06a0a6 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Tue, 11 Apr 2017 22:14:33 +0900 Subject: APIv4 GET /posts/{post_id}/reactions (#6047) --- app/reaction.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/reaction.go (limited to 'app/reaction.go') 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 + } +} -- cgit v1.2.3-1-g7c22