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 удалений

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

@@ -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 {