From 3d0133b5e85660b942773f7cc63e6e8bc357462c Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 11 Aug 2015 09:28:44 -0400 Subject: added api unit test for GetChannelCounts --- model/client.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'model/client.go') diff --git a/model/client.go b/model/client.go index 9ae0a66e5..6fcfa5043 100644 --- a/model/client.go +++ b/model/client.go @@ -408,6 +408,15 @@ func (c *Client) GetMoreChannels(etag string) (*Result, *AppError) { } } +func (c *Client) GetChannelCounts(etag string) (*Result, *AppError) { + if r, err := c.DoGet("/channels/counts", "", etag); err != nil { + return nil, err + } else { + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), ChannelCountsFromJson(r.Body)}, nil + } +} + func (c *Client) JoinChannel(id string) (*Result, *AppError) { if r, err := c.DoPost("/channels/"+id+"/join", ""); err != nil { return nil, err -- cgit v1.2.3-1-g7c22