aboutsummaryrefslogtreecommitdiff
path: root/models/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index cc3e4ad0..dbe01f6f 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1405,6 +1405,10 @@ func (m *Milestone) State() api.StateType {
return api.STATE_OPEN
}
+func (m *Milestone) ChangeStatus(isClosed bool) error {
+ return ChangeMilestoneStatus(m, isClosed)
+}
+
func (m *Milestone) APIFormat() *api.Milestone {
apiMilestone := &api.Milestone{
ID: m.ID,
@@ -1513,6 +1517,8 @@ func MilestoneStats(repoID int64) (open int64, closed int64) {
}
// ChangeMilestoneStatus changes the milestone open/closed status.
+// If milestone passes with changed values, those values will be
+// updated to database as well.
func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) {
repo, err := GetRepositoryByID(m.RepoID)
if err != nil {