aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-02-10 15:54:02 -0500
committerUnknwon <u@gogs.io>2017-02-10 15:54:02 -0500
commit3f95824e656f2eb6a193038d58316b5abf0b1888 (patch)
treeceecda075c05e3c84f112653ce88e192f57ff0e1 /models
parent29722af1ae51333a7da742b5e02a5e7fe5983aab (diff)
api/repo/milestone: fix change status didn't take effect
Diffstat (limited to 'models')
-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 {