MM-23722 add endpoint for modify team privacy (#14287)
* MM-23722 add Rest API for updating team privacy * unit tests for UpdateTeamPrivacy
Этот коммит содержится в:
@@ -1794,6 +1794,18 @@ func (c *Client4) PermanentDeleteTeam(teamId string) (bool, *Response) {
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
|
||||
// UpdateTeamPrivacy modifies the team type (model.TEAM_OPEN <--> model.TEAM_INVITE) and sets
|
||||
// the corresponding AllowOpenInvite appropriately.
|
||||
func (c *Client4) UpdateTeamPrivacy(teamId string, privacy string) (*Team, *Response) {
|
||||
requestBody := map[string]string{"privacy": privacy}
|
||||
r, err := c.DoApiPut(c.GetTeamRoute(teamId)+"/privacy", MapToJson(requestBody))
|
||||
if err != nil {
|
||||
return nil, BuildErrorResponse(r, err)
|
||||
}
|
||||
defer closeBody(r)
|
||||
return TeamFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
|
||||
// GetTeamMembers returns team members based on the provided team id string.
|
||||
func (c *Client4) GetTeamMembers(teamId string, page int, perPage int, etag string) ([]*TeamMember, *Response) {
|
||||
query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)
|
||||
|
||||
Ссылка в новой задаче
Block a user