diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-01-31 07:59:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-31 07:59:36 -0500 |
commit | 7431050b427af88c5e5358bf086176d7a680149b (patch) | |
tree | d75e8bd406086509e032be9b65cb42681393cd92 /model/client4.go | |
parent | 450c0b3ccb091a3f84f35aca0319ba358ffd5633 (diff) | |
download | chat-7431050b427af88c5e5358bf086176d7a680149b.tar.gz chat-7431050b427af88c5e5358bf086176d7a680149b.tar.bz2 chat-7431050b427af88c5e5358bf086176d7a680149b.zip |
Implement POST /teams endpoint (#5220)
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/model/client4.go b/model/client4.go index 3c585fbe4..6752a4b60 100644 --- a/model/client4.go +++ b/model/client4.go @@ -213,7 +213,16 @@ func (c *Client4) UpdateUser(user *User) (*User, *Response) { } // Team Section -// to be filled in.. + +// CreateTeam creates a team in the system based on the provided team struct. +func (c *Client4) CreateTeam(team *Team) (*Team, *Response) { + if r, err := c.DoApiPost(c.GetTeamsRoute(), team.ToJson()); err != nil { + return nil, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return TeamFromJson(r.Body), BuildResponse(r) + } +} // Channel Section // to be filled in.. |