diff options
author | Jack <jackdeng@gmail.com> | 2015-09-28 08:14:57 -0700 |
---|---|---|
committer | Jack <jackdeng@gmail.com> | 2015-09-28 08:14:57 -0700 |
commit | 503501ab3b616fb9fa57b046df850cfc2db734f8 (patch) | |
tree | 43e529250bab982c73816f1ffdf673e8e4b98c13 /model/client.go | |
parent | aa6da728baf2f5642293d8b56ebc1ff4e8682bce (diff) | |
parent | a055fd10b83b28bf97877e4e28a2275f74a71a4a (diff) | |
download | chat-503501ab3b616fb9fa57b046df850cfc2db734f8.tar.gz chat-503501ab3b616fb9fa57b046df850cfc2db734f8.tar.bz2 chat-503501ab3b616fb9fa57b046df850cfc2db734f8.zip |
rebase
Diffstat (limited to 'model/client.go')
-rw-r--r-- | model/client.go | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/model/client.go b/model/client.go index cc75ce370..26e00864d 100644 --- a/model/client.go +++ b/model/client.go @@ -150,6 +150,16 @@ func (c *Client) CreateTeam(team *Team) (*Result, *AppError) { } } +func (c *Client) GetAllTeams() (*Result, *AppError) { + if r, err := c.DoApiGet("/teams/all", "", ""); err != nil { + return nil, err + } else { + + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), TeamMapFromJson(r.Body)}, nil + } +} + func (c *Client) FindTeamByName(name string, allServers bool) (*Result, *AppError) { m := make(map[string]string) m["name"] = name @@ -208,15 +218,6 @@ func (c *Client) UpdateTeamDisplayName(data map[string]string) (*Result, *AppErr } } -func (c *Client) UpdateValetFeature(data map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost("/teams/update_valet_feature", MapToJson(data)); err != nil { - return nil, err - } else { - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - func (c *Client) CreateUser(user *User, hash string) (*Result, *AppError) { if r, err := c.DoApiPost("/users/create", user.ToJson()); err != nil { return nil, err @@ -254,7 +255,7 @@ func (c *Client) GetMe(etag string) (*Result, *AppError) { } func (c *Client) GetProfiles(teamId string, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet("/users/profiles", "", etag); err != nil { + if r, err := c.DoApiGet("/users/profiles/"+teamId, "", etag); err != nil { return nil, err } else { return &Result{r.Header.Get(HEADER_REQUEST_ID), @@ -570,15 +571,6 @@ func (c *Client) CreatePost(post *Post) (*Result, *AppError) { } } -func (c *Client) CreateValetPost(post *Post) (*Result, *AppError) { - if r, err := c.DoApiPost("/channels/"+post.ChannelId+"/valet_create", post.ToJson()); err != nil { - return nil, err - } else { - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostFromJson(r.Body)}, nil - } -} - func (c *Client) UpdatePost(post *Post) (*Result, *AppError) { if r, err := c.DoApiPost("/channels/"+post.ChannelId+"/update", post.ToJson()); err != nil { return nil, err |