diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-04-19 05:15:15 +0900 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-04-18 16:15:15 -0400 |
commit | d2b86f1b8de4784baf578b611cf80779ccfa722a (patch) | |
tree | 076d56f2522c0d9580e04061db3cce99facce67b /api | |
parent | 8aab290d10cc7cdd864cebbd463044abfa2d2aea (diff) | |
download | chat-d2b86f1b8de4784baf578b611cf80779ccfa722a.tar.gz chat-d2b86f1b8de4784baf578b611cf80779ccfa722a.tar.bz2 chat-d2b86f1b8de4784baf578b611cf80779ccfa722a.zip |
APIv4 POST /reactions (#6092)
* APIv4 POST /reactions
* update corresponding V3 endpoint
Diffstat (limited to 'api')
-rw-r--r-- | api/reaction.go | 11 |
1 files changed, 3 insertions, 8 deletions
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 } } |