summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <ZJvandeWeg@users.noreply.github.com>2017-06-15 14:13:18 +0200
committerJoram Wilander <jwawilander@gmail.com>2017-06-15 08:13:18 -0400
commit0c04c5334fc89cf62a4bd3c1ce20469523a24026 (patch)
tree30b56cf82205ef5d739059ec1b3a24865e8d0fb3 /app
parent98ac903fce24418538edbec77a218bcac9e20cd2 (diff)
downloadchat-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')
-rw-r--r--app/team.go9
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 {