summaryrefslogtreecommitdiffstats
path: root/api4/command.go
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2018-07-06 21:07:42 +0800
committerJoram Wilander <jwawilander@gmail.com>2018-07-06 09:07:42 -0400
commit9e5ec7d09d4c51e278f17f25fb6c0f3484b50a3b (patch)
tree592ab1107b664fdd0f21017973decfe6798fa7ed /api4/command.go
parenta92f5addccad0f77079308ff853a8251db5f2d09 (diff)
downloadchat-9e5ec7d09d4c51e278f17f25fb6c0f3484b50a3b.tar.gz
chat-9e5ec7d09d4c51e278f17f25fb6c0f3484b50a3b.tar.bz2
chat-9e5ec7d09d4c51e278f17f25fb6c0f3484b50a3b.zip
[MM-10754] Remove unnecessary command_test route (#9050)
* remove unnecessary command_test route * replaced localhost with ts.URL
Diffstat (limited to 'api4/command.go')
-rw-r--r--api4/command.go26
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()))
-}