aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/setting/collaboration.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-09-08 12:51:15 +0800
committerGitHub <noreply@github.com>2023-09-08 04:51:15 +0000
commit4f32abaf941ba30ade1f96930a05d14f1c6a6782 (patch)
tree9351b7d654b20db032867041b0292924ec93bb3f /routers/web/repo/setting/collaboration.go
parent3c0c27965836328abd2668dcd77710ee2460535e (diff)
downloadgitea-4f32abaf941ba30ade1f96930a05d14f1c6a6782.tar.gz
gitea-4f32abaf941ba30ade1f96930a05d14f1c6a6782.zip
move repository deletion to service layer (#26948)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/web/repo/setting/collaboration.go')
-rw-r--r--routers/web/repo/setting/collaboration.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/web/repo/setting/collaboration.go b/routers/web/repo/setting/collaboration.go
index b708422cbd..84e5fd30ca 100644
--- a/routers/web/repo/setting/collaboration.go
+++ b/routers/web/repo/setting/collaboration.go
@@ -21,6 +21,7 @@ import (
"code.gitea.io/gitea/routers/utils"
"code.gitea.io/gitea/services/mailer"
org_service "code.gitea.io/gitea/services/org"
+ repo_service "code.gitea.io/gitea/services/repository"
)
// Collaboration render a repository's collaboration page
@@ -196,7 +197,7 @@ func DeleteTeam(ctx *context.Context) {
return
}
- if err = models.RemoveRepository(team, ctx.Repo.Repository.ID); err != nil {
+ if err = repo_service.RemoveRepositoryFromTeam(ctx, team, ctx.Repo.Repository.ID); err != nil {
ctx.ServerError("team.RemoveRepositorys", err)
return
}