MM-23596: Ability to list private channels for team (#14925)

Summary:
store, app, api and go driver support for listing private channels

Ticket Link:
https://mattermost.atlassian.net/browse/MM-23596
Этот коммит содержится в:
Ashish Bhate
2020-07-06 12:34:29 +05:30
коммит произвёл GitHub
родитель a4fc0fcfb7
Коммит af8b914c6c
15 изменённых файлов: 315 добавлений и 0 удалений

Просмотреть файл

@@ -2385,6 +2385,17 @@ func (c *Client4) GetPinnedPosts(channelId string, etag string) (*PostList, *Res
return PostListFromJson(r.Body), BuildResponse(r)
}
// GetPrivateChannelsForTeam returns a list of private channels based on the provided team id string.
func (c *Client4) GetPrivateChannelsForTeam(teamId string, page int, perPage int, etag string) ([]*Channel, *Response) {
query := fmt.Sprintf("/private?page=%v&per_page=%v", page, perPage)
r, err := c.DoApiGet(c.GetChannelsForTeamRoute(teamId)+query, etag)
if err != nil {
return nil, BuildErrorResponse(r, err)
}
defer closeBody(r)
return ChannelSliceFromJson(r.Body), BuildResponse(r)
}
// GetPublicChannelsForTeam returns a list of public channels based on the provided team id string.
func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int, etag string) ([]*Channel, *Response) {
query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)