summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-04-10 22:27:10 +0900
committerHarrison Healey <harrisonmhealey@gmail.com>2017-04-10 09:27:10 -0400
commit3b1088f3bdb43125d81645697dfd70bdae033bfc (patch)
tree591eeb1c88b7db52f274db0594cfa3377df0f8d4 /model
parent38eced02908ea95cc2a52167d48c086d09db3532 (diff)
downloadchat-3b1088f3bdb43125d81645697dfd70bdae033bfc.tar.gz
chat-3b1088f3bdb43125d81645697dfd70bdae033bfc.tar.bz2
chat-3b1088f3bdb43125d81645697dfd70bdae033bfc.zip
APIv4 DELETE /commands/{command_id} (#6012)
Diffstat (limited to 'model')
-rw-r--r--model/client4.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index 6d4772431..f078a33fe 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -2212,6 +2212,16 @@ func (c *Client4) UpdateCommand(cmd *Command) (*Command, *Response) {
}
}
+// DeleteCommand deletes a command based on the provided command id string
+func (c *Client4) DeleteCommand(commandId string) (bool, *Response) {
+ if r, err := c.DoApiDelete(c.GetCommandRoute(commandId)); err != nil {
+ return false, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return CheckStatusOK(r), BuildResponse(r)
+ }
+}
+
// ListCommands will retrieve a list of commands available in the team.
func (c *Client4) ListCommands(teamId string, customOnly bool) ([]*Command, *Response) {
query := fmt.Sprintf("?team_id=%v&custom_only=%v", teamId, customOnly)