added getChannel api service and use that over getChannels where appropriate on client

Этот коммит содержится в:
JoramWilander
2015-07-27 11:30:03 -04:00
родитель 4c7cdb20f0
Коммит 1c0ee4d2f6
10 изменённых файлов: 190 добавлений и 10 удалений

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

@@ -390,6 +390,15 @@ func (c *Client) GetChannels(etag string) (*Result, *AppError) {
}
}
func (c *Client) GetChannel(id, etag string) (*Result, *AppError) {
if r, err := c.DoGet("/channels/"+id+"/", "", etag); err != nil {
return nil, err
} else {
return &Result{r.Header.Get(HEADER_REQUEST_ID),
r.Header.Get(HEADER_ETAG_SERVER), ChannelDataFromJson(r.Body)}, nil
}
}
func (c *Client) GetMoreChannels(etag string) (*Result, *AppError) {
if r, err := c.DoGet("/channels/more", "", etag); err != nil {
return nil, err