Refactored CreatePost to not use context (#3813)

This commit is contained in:
David Lu
2016-08-19 08:08:31 -04:00
committed by Joram Wilander
parent 9ad50d4d75
commit 8c2ea22892
10 changed files with 5855 additions and 67 deletions

View File

@@ -247,7 +247,8 @@ func handleResponse(c *Context, w http.ResponseWriter, response *model.CommandRe
if response.ResponseType == model.COMMAND_RESPONSE_TYPE_IN_CHANNEL {
post.Message = response.Text
if _, err := CreatePost(c, post, true); err != nil {
post.UserId = c.Session.UserId
if _, err := CreatePost(c.TeamId, post, true); err != nil {
c.Err = model.NewLocAppError("command", "api.command.execute_command.save.app_error", nil, "")
}
} else if response.ResponseType == model.COMMAND_RESPONSE_TYPE_EPHEMERAL && response.Text != "" {