summaryrefslogtreecommitdiffstats
path: root/api4/command.go
diff options
context:
space:
mode:
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()))
-}