Add APIv4 endpoint to permanently delete teams (#6604)

Tests are added, however, it only tests the property if its soft deleted. In the
background it will be hard deleted, but that is untestable through a integration
test.
Этот коммит содержится в:
Zeger-Jan van de Weg
2017-06-15 14:13:18 +02:00
коммит произвёл Joram Wilander
родитель 98ac903fce
Коммит 0c04c5334f
5 изменённых файлов: 67 добавлений и 3 удалений

Просмотреть файл

@@ -1046,6 +1046,17 @@ func (c *Client4) SoftDeleteTeam(teamId string) (bool, *Response) {
}
}
// PermanentDeleteTeam deletes the team, should only be used when needed for
// compliance and the like
func (c *Client4) PermanentDeleteTeam(teamId string) (bool, *Response) {
if r, err := c.DoApiDelete(c.GetTeamRoute(teamId) + "?permanent=true"); err != nil {
return false, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return CheckStatusOK(r), 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)