diff options
Diffstat (limited to 'model')
-rw-r--r-- | model/client4.go | 10 |
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) |