diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-03-29 15:23:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 15:23:45 +0800 |
commit | 76aa33d884af283619054ed14a6137efc14b6d35 (patch) | |
tree | 238f2bc5add522767df93cd6064ed4037b0d3b1b /routers/api | |
parent | b06b9a056c0af751e576978f6ef3c914ee959b9c (diff) | |
download | gitea-76aa33d884af283619054ed14a6137efc14b6d35.tar.gz gitea-76aa33d884af283619054ed14a6137efc14b6d35.zip |
Move init repository related functions to modules (#19159)
* Move init repository related functions to modules
* Fix lint
* Use ctx but db.DefaultContext
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/org/label.go | 2 | ||||
-rw-r--r-- | routers/api/v1/repo/label.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/org/label.go b/routers/api/v1/org/label.go index 7d4c12d364..d36b1d9a98 100644 --- a/routers/api/v1/org/label.go +++ b/routers/api/v1/org/label.go @@ -99,7 +99,7 @@ func CreateLabel(ctx *context.APIContext) { OrgID: ctx.Org.Organization.ID, Description: form.Description, } - if err := models.NewLabel(label); err != nil { + if err := models.NewLabel(ctx, label); err != nil { ctx.Error(http.StatusInternalServerError, "NewLabel", err) return } diff --git a/routers/api/v1/repo/label.go b/routers/api/v1/repo/label.go index 67682fc60d..ab559a2eed 100644 --- a/routers/api/v1/repo/label.go +++ b/routers/api/v1/repo/label.go @@ -161,7 +161,7 @@ func CreateLabel(ctx *context.APIContext) { RepoID: ctx.Repo.Repository.ID, Description: form.Description, } - if err := models.NewLabel(label); err != nil { + if err := models.NewLabel(ctx, label); err != nil { ctx.Error(http.StatusInternalServerError, "NewLabel", err) return } |