2019-11-02 06:33:20 +03:00
|
|
|
// 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"
|
2021-11-24 12:49:20 +03:00
|
|
|
user_model "code.gitea.io/gitea/models/user"
|
2019-11-02 06:33:20 +03:00
|
|
|
"code.gitea.io/gitea/modules/notification"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ChangeMilestoneAssign changes assignment of milestone for issue.
|
2021-11-24 12:49:20 +03:00
|
|
|
func ChangeMilestoneAssign(issue *models.Issue, doer *user_model.User, oldMilestoneID int64) (err error) {
|
2019-11-02 06:33:20 +03:00
|
|
|
if err = models.ChangeMilestoneAssign(issue, doer, oldMilestoneID); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
notification.NotifyIssueChangeMilestone(doer, issue, oldMilestoneID)
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|