diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-10-26 14:54:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-26 14:54:11 +0800 |
commit | 9e85358777ea4bd345f832d08b19915a72cc128b (patch) | |
tree | 56116e7a6acbfd91a29cade7f753802f9ea561ea /routers/admin | |
parent | d2d5910894cfe513f8aa331b30c991db6fbe8e6d (diff) | |
download | gitea-9e85358777ea4bd345f832d08b19915a72cc128b.tar.gz gitea-9e85358777ea4bd345f832d08b19915a72cc128b.zip |
Move some repositories' operations to a standalone service package (#8557)
* Move some repositories' operations to a standalone service package
* improve code
* remove unused codes
* add rollback when fork failed
* add repo when return
Diffstat (limited to 'routers/admin')
-rw-r--r-- | routers/admin/repos.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/admin/repos.go b/routers/admin/repos.go index d345c8e76a..73aa66807b 100644 --- a/routers/admin/repos.go +++ b/routers/admin/repos.go @@ -11,6 +11,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/routers" + repo_service "code.gitea.io/gitea/services/repository" ) const ( @@ -38,7 +39,7 @@ func DeleteRepo(ctx *context.Context) { return } - if err := models.DeleteRepository(ctx.User, repo.MustOwner().ID, repo.ID); err != nil { + if err := repo_service.DeleteRepository(ctx.User, repo); err != nil { ctx.ServerError("DeleteRepository", err) return } |