diff options
author | Zeger-Jan van de Weg <ZJvandeWeg@users.noreply.github.com> | 2017-06-15 14:13:18 +0200 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-06-15 08:13:18 -0400 |
commit | 0c04c5334fc89cf62a4bd3c1ce20469523a24026 (patch) | |
tree | 30b56cf82205ef5d739059ec1b3a24865e8d0fb3 /model/client4.go | |
parent | 98ac903fce24418538edbec77a218bcac9e20cd2 (diff) | |
download | chat-0c04c5334fc89cf62a4bd3c1ce20469523a24026.tar.gz chat-0c04c5334fc89cf62a4bd3c1ce20469523a24026.tar.bz2 chat-0c04c5334fc89cf62a4bd3c1ce20469523a24026.zip |
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.
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index fce4c678f..c692a8415 100644 --- a/model/client4.go +++ b/model/client4.go @@ -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) |