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/repo/setting.go | |
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/repo/setting.go')
-rw-r--r-- | routers/repo/setting.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index c74b273420..663394fe3d 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -26,6 +26,7 @@ import ( "code.gitea.io/gitea/routers/utils" "code.gitea.io/gitea/services/mailer" mirror_service "code.gitea.io/gitea/services/mirror" + repo_service "code.gitea.io/gitea/services/repository" "github.com/unknwon/com" "mvdan.cc/xurls/v2" @@ -407,7 +408,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { return } - if err := models.DeleteRepository(ctx.User, ctx.Repo.Owner.ID, repo.ID); err != nil { + if err := repo_service.DeleteRepository(ctx.User, ctx.Repo.Repository); err != nil { ctx.ServerError("DeleteRepository", err) return } |