From d2b86f1b8de4784baf578b611cf80779ccfa722a Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Wed, 19 Apr 2017 05:15:15 +0900 Subject: APIv4 POST /reactions (#6092) * APIv4 POST /reactions * update corresponding V3 endpoint --- api/reaction.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'api') diff --git a/api/reaction.go b/api/reaction.go index a4992d61b..9def7274a 100644 --- a/api/reaction.go +++ b/api/reaction.go @@ -65,17 +65,12 @@ func saveReaction(c *Context, w http.ResponseWriter, r *http.Request) { return } - if result := <-app.Srv.Store.Reaction().Save(reaction); result.Err != nil { - c.Err = result.Err + if reaction, err := app.SaveReactionForPost(reaction); err != nil { + c.Err = err return } else { - go sendReactionEvent(model.WEBSOCKET_EVENT_REACTION_ADDED, channelId, reaction, post) - - reaction := result.Data.(*model.Reaction) - - app.InvalidateCacheForReactions(reaction.PostId) - w.Write([]byte(reaction.ToJson())) + return } } -- cgit v1.2.3-1-g7c22