diff options
author | Robin Naundorf <r.naundorf@fh-muenster.de> | 2017-05-09 14:52:46 +0200 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-05-09 07:52:46 -0500 |
commit | 5efcd2d9d3fb91ae7475918b807b7947b533da9b (patch) | |
tree | 7f1c0bfe5ca751b27b6a520f63cd20e280377d85 /model | |
parent | 530814b8c9b1b47dd6eb05e70548c61d75da9a23 (diff) | |
download | chat-5efcd2d9d3fb91ae7475918b807b7947b533da9b.tar.gz chat-5efcd2d9d3fb91ae7475918b807b7947b533da9b.tar.bz2 chat-5efcd2d9d3fb91ae7475918b807b7947b533da9b.zip |
Add API Endpoint for deleted Channels (#5889)
Diffstat (limited to 'model')
-rw-r--r-- | model/client4.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index 3a6507f82..7e0cd1acf 100644 --- a/model/client4.go +++ b/model/client4.go @@ -1242,6 +1242,17 @@ func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int, } } +// GetDeletedChannelsForTeam returns a list of public channels based on the provided team id string. +func (c *Client4) GetDeletedChannelsForTeam(teamId string, page int, perPage int, etag string) (*ChannelList, *Response) { + query := fmt.Sprintf("/deleted?page=%v&per_page=%v", page, perPage) + if r, err := c.DoApiGet(c.GetChannelsForTeamRoute(teamId)+query, etag); err != nil { + return nil, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return ChannelListFromJson(r.Body), BuildResponse(r) + } +} + // GetPublicChannelsByIdsForTeam returns a list of public channels based on provided team id string func (c *Client4) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) (*ChannelList, *Response) { if r, err := c.DoApiPost(c.GetChannelsForTeamRoute(teamId)+"/ids", ArrayToJson(channelIds)); err != nil { |