From 0c04c5334fc89cf62a4bd3c1ce20469523a24026 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 15 Jun 2017 14:13:18 +0200 Subject: 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. --- app/team.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/team.go') 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 { -- cgit v1.2.3-1-g7c22