diff options
author | JoramWilander <jwawilander@gmail.com> | 2018-07-07 12:04:18 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2018-07-07 12:04:18 -0400 |
commit | b78b216a3c8eb354085f97f33dac5e7661ac9188 (patch) | |
tree | dc7a253730a684bc6744c0b0bf36a87944242583 /api4/command.go | |
parent | 359f12db33d45b6ffade0872ddf3652a5c52f4a8 (diff) | |
parent | 9e5ec7d09d4c51e278f17f25fb6c0f3484b50a3b (diff) | |
download | chat-b78b216a3c8eb354085f97f33dac5e7661ac9188.tar.gz chat-b78b216a3c8eb354085f97f33dac5e7661ac9188.tar.bz2 chat-b78b216a3c8eb354085f97f33dac5e7661ac9188.zip |
Merge branch 'master' into plugins-2
Diffstat (limited to 'api4/command.go')
-rw-r--r-- | api4/command.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/api4/command.go b/api4/command.go index 3ab2839ba..69efee010 100644 --- a/api4/command.go +++ b/api4/command.go @@ -4,7 +4,6 @@ package api4 import ( - "io/ioutil" "net/http" "strconv" "strings" @@ -22,9 +21,6 @@ func (api *API) InitCommand() { api.BaseRoutes.Team.Handle("/commands/autocomplete", api.ApiSessionRequired(listAutocompleteCommands)).Methods("GET") api.BaseRoutes.Command.Handle("/regen_token", api.ApiSessionRequired(regenCommandToken)).Methods("PUT") - - api.BaseRoutes.Teams.Handle("/command_test", api.ApiHandler(testCommand)).Methods("POST") - api.BaseRoutes.Teams.Handle("/command_test", api.ApiHandler(testCommand)).Methods("GET") } func createCommand(c *Context, w http.ResponseWriter, r *http.Request) { @@ -291,25 +287,3 @@ func regenCommandToken(c *Context, w http.ResponseWriter, r *http.Request) { w.Write([]byte(model.MapToJson(resp))) } - -func testCommand(c *Context, w http.ResponseWriter, r *http.Request) { - r.ParseForm() - - msg := "" - if r.Method == "POST" { - msg = msg + "\ntoken=" + r.FormValue("token") - msg = msg + "\nteam_domain=" + r.FormValue("team_domain") - } else { - body, _ := ioutil.ReadAll(r.Body) - msg = string(body) - } - - rc := &model.CommandResponse{ - Text: "test command response " + msg, - ResponseType: model.COMMAND_RESPONSE_TYPE_IN_CHANNEL, - Type: "custom_test", - Props: map[string]interface{}{"someprop": "somevalue"}, - } - - w.Write([]byte(rc.ToJson())) -} |