diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-02 11:33:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-02 11:33:20 +0800 |
commit | 8f26397928b33a16558dafc2716a72b6e6900bf4 (patch) | |
tree | 64604da13ff190b9aa6d3f4dc94fe7c8352a99e9 /services/issue | |
parent | f518fe66620bcb60a5251befca116f8caa48ee42 (diff) | |
download | gitea-8f26397928b33a16558dafc2716a72b6e6900bf4.tar.gz gitea-8f26397928b33a16558dafc2716a72b6e6900bf4.zip |
Move issue milestone assign to issue service and move webhook to notification (#8780)
Diffstat (limited to 'services/issue')
-rw-r--r-- | services/issue/milestone.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/services/issue/milestone.go b/services/issue/milestone.go new file mode 100644 index 0000000000..6fe527f58c --- /dev/null +++ b/services/issue/milestone.go @@ -0,0 +1,21 @@ +// Copyright 2019 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package issue + +import ( + "code.gitea.io/gitea/models" + "code.gitea.io/gitea/modules/notification" +) + +// ChangeMilestoneAssign changes assignment of milestone for issue. +func ChangeMilestoneAssign(issue *models.Issue, doer *models.User, oldMilestoneID int64) (err error) { + if err = models.ChangeMilestoneAssign(issue, doer, oldMilestoneID); err != nil { + return + } + + notification.NotifyIssueChangeMilestone(doer, issue, oldMilestoneID) + + return nil +} |