MM-11725: Add specific autocomplete endpoint for search autocomplete (#9337)

Этот коммит содержится в:
Jesús Espino
2018-09-11 22:45:31 +02:00
коммит произвёл GitHub
родитель d585f9d9a3
Коммит e32581aef3
7 изменённых файлов: 197 добавлений и 0 удалений

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

@@ -1961,6 +1961,17 @@ func (c *Client4) AutocompleteChannelsForTeam(teamId, name string) (*ChannelList
}
}
// AutocompleteChannelsForTeamForSearch will return an ordered list of your channels autocomplete suggestions
func (c *Client4) AutocompleteChannelsForTeamForSearch(teamId, name string) (*ChannelList, *Response) {
query := fmt.Sprintf("?name=%v", name)
if r, err := c.DoApiGet(c.GetChannelsForTeamRoute(teamId)+"/search_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.