diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-09-30 21:50:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-30 21:50:44 +0800 |
commit | e6113000c5cbbdbf10af7bda472fc8b254ec7605 (patch) | |
tree | e7b9fd86a4e7451083c298d29f09ecaaedf9970c /routers/repo | |
parent | a5992d172551f7821e023cd3cbca1a7cc0b919ee (diff) | |
download | gitea-e6113000c5cbbdbf10af7bda472fc8b254ec7605.tar.gz gitea-e6113000c5cbbdbf10af7bda472fc8b254ec7605.zip |
Extract actions on new issue from models to services (#8217)
* extract actions on new issue from models to services
* improve code
* rename services/issues to services/issue
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/issue.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 1be0b408a6..e4ef3b1dbb 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -27,6 +27,7 @@ import ( api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/util" comment_service "code.gitea.io/gitea/services/comments" + issue_service "code.gitea.io/gitea/services/issue" milestone_service "code.gitea.io/gitea/services/milestone" "github.com/unknwon/com" @@ -571,7 +572,7 @@ func NewIssuePost(ctx *context.Context, form auth.CreateIssueForm) { Content: form.Content, Ref: form.Ref, } - if err := models.NewIssue(repo, issue, labelIDs, assigneeIDs, attachments); err != nil { + if err := issue_service.NewIssue(repo, issue, labelIDs, assigneeIDs, attachments); err != nil { if models.IsErrUserDoesNotHaveAccessToRepo(err) { ctx.Error(400, "UserDoesNotHaveAccessToRepo", err.Error()) return |