Adding go client support and basic unit tests for channel autocomplete. (#8510)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2bf2b5b851
Коммит
4a69c277a6
@@ -1744,6 +1744,17 @@ func (c *Client4) RemoveUserFromChannel(channelId, userId string) (bool, *Respon
|
||||
}
|
||||
}
|
||||
|
||||
// AutocompleteChannelsForTeam will return an ordered list of channels autocomplete suggestions
|
||||
func (c *Client4) AutocompleteChannelsForTeam(teamId, name string) (*ChannelList, *Response) {
|
||||
query := fmt.Sprintf("?name=%v", name)
|
||||
if r, err := c.DoApiGet(c.GetChannelsForTeamRoute(teamId)+"/autocomplete"+query, ""); err != nil {
|
||||
return nil, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return ChannelListFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// Post Section
|
||||
|
||||
// CreatePost creates a post based on the provided post struct.
|
||||
|
||||
Ссылка в новой задаче
Block a user