mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix Go client’s GetTeamByName() (#6088)
This commit is contained in:
committed by
Corey Hulen
parent
8b8aa2ca3c
commit
8072bb6f57
@@ -1841,15 +1841,14 @@ func (c *Client) GetTeamStats(teamId string) (*Result, *AppError) {
|
||||
}
|
||||
}
|
||||
|
||||
// GetTeamStats will return a team stats object containing the number of users on the team
|
||||
// based on the team id provided. Must be authenticated.
|
||||
// GetTeamByName will return a team object based on the team name provided. Must be authenticated.
|
||||
func (c *Client) GetTeamByName(teamName string) (*Result, *AppError) {
|
||||
if r, err := c.DoApiGet(fmt.Sprintf("/teams/name/%v", teamName), "", ""); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return &Result{r.Header.Get(HEADER_REQUEST_ID),
|
||||
r.Header.Get(HEADER_ETAG_SERVER), TeamStatsFromJson(r.Body)}, nil
|
||||
r.Header.Get(HEADER_ETAG_SERVER), TeamFromJson(r.Body)}, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user