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 /app/team.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 'app/team.go')
-rw-r--r-- | app/team.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/team.go b/app/team.go index acc3966b9..317315f06 100644 --- a/app/team.go +++ b/app/team.go @@ -690,6 +690,15 @@ func GetTeamsUnreadForUser(excludeTeamId string, userId string) ([]*model.TeamUn } } +func PermanentDeleteTeamId(teamId string) *model.AppError { + team, err := GetTeam(teamId) + if err != nil { + return err + } + + return PermanentDeleteTeam(team) +} + func PermanentDeleteTeam(team *model.Team) *model.AppError { team.DeleteAt = model.GetMillis() if result := <-Srv.Store.Team().Update(team); result.Err != nil { |