summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-03-14 21:08:58 +0900
committerGeorge Goldberg <george@gberg.me>2017-03-14 12:08:58 +0000
commita71a9fc3bff1b6a6c9d5e0a65f53686922572834 (patch)
treec132dcdb82cef953634e091d91fddab1c3572efe /model
parentaafc63933a7e213261e28ac7f528cea50b70e1af (diff)
downloadchat-a71a9fc3bff1b6a6c9d5e0a65f53686922572834.tar.gz
chat-a71a9fc3bff1b6a6c9d5e0a65f53686922572834.tar.bz2
chat-a71a9fc3bff1b6a6c9d5e0a65f53686922572834.zip
APIv4 DELETE channels/{channel_id} (#5723)
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 16e8bf7d3..38b89e74f 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -841,6 +841,16 @@ func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int,
}
}
+// DeleteChannel deletes channel based on the provided channel id string.
+func (c *Client4) DeleteChannel(channelId string) (bool, *Response) {
+ if r, err := c.DoApiDelete(c.GetChannelRoute(channelId)); err != nil {
+ return false, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return CheckStatusOK(r), BuildResponse(r)
+ }
+}
+
// GetChannelByName returns a channel based on the provided channel name and team id strings.
func (c *Client4) GetChannelByName(channelName, teamId string, etag string) (*Channel, *Response) {
if r, err := c.DoApiGet(c.GetChannelByNameRoute(channelName, teamId), etag); err != nil {