summaryrefslogtreecommitdiffstats
path: root/services/issue/milestone.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-06-13 17:37:59 +0800
committerGitHub <noreply@github.com>2022-06-13 17:37:59 +0800
commit1a9821f57a0293db3adc0eab8aff08ca5fa1026c (patch)
tree3c3d02813eb63c0d0827ef6d9745f6dcdd2636cb /services/issue/milestone.go
parent3708ca8e2849ca7e36e6bd15ec6935a2a2d81e55 (diff)
downloadgitea-1a9821f57a0293db3adc0eab8aff08ca5fa1026c.tar.gz
gitea-1a9821f57a0293db3adc0eab8aff08ca5fa1026c.zip
Move issues related files into models/issues (#19931)
* Move access and repo permission to models/perm/access * fix test * fix git test * Move functions sequence * Some improvements per @KN4CK3R and @delvh * Move issues related code to models/issues * Move some issues related sub package * Merge * Fix test * Fix test * Fix test * Fix test * Rename some files
Diffstat (limited to 'services/issue/milestone.go')
-rw-r--r--services/issue/milestone.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/services/issue/milestone.go b/services/issue/milestone.go
index 287f8ae285..af337c3f14 100644
--- a/services/issue/milestone.go
+++ b/services/issue/milestone.go
@@ -8,15 +8,14 @@ import (
"context"
"fmt"
- "code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
issues_model "code.gitea.io/gitea/models/issues"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/notification"
)
-func changeMilestoneAssign(ctx context.Context, doer *user_model.User, issue *models.Issue, oldMilestoneID int64) error {
- if err := models.UpdateIssueCols(ctx, issue, "milestone_id"); err != nil {
+func changeMilestoneAssign(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldMilestoneID int64) error {
+ if err := issues_model.UpdateIssueCols(ctx, issue, "milestone_id"); err != nil {
return err
}
@@ -37,15 +36,15 @@ func changeMilestoneAssign(ctx context.Context, doer *user_model.User, issue *mo
return err
}
- opts := &models.CreateCommentOptions{
- Type: models.CommentTypeMilestone,
+ opts := &issues_model.CreateCommentOptions{
+ Type: issues_model.CommentTypeMilestone,
Doer: doer,
Repo: issue.Repo,
Issue: issue,
OldMilestoneID: oldMilestoneID,
MilestoneID: issue.MilestoneID,
}
- if _, err := models.CreateCommentCtx(ctx, opts); err != nil {
+ if _, err := issues_model.CreateCommentCtx(ctx, opts); err != nil {
return err
}
}
@@ -54,7 +53,7 @@ func changeMilestoneAssign(ctx context.Context, doer *user_model.User, issue *mo
}
// ChangeMilestoneAssign changes assignment of milestone for issue.
-func ChangeMilestoneAssign(issue *models.Issue, doer *user_model.User, oldMilestoneID int64) (err error) {
+func ChangeMilestoneAssign(issue *issues_model.Issue, doer *user_model.User, oldMilestoneID int64) (err error) {
ctx, committer, err := db.TxContext()
if err != nil {
return err