summaryrefslogtreecommitdiffstats
path: root/models/issue_milestone.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-11-29 09:46:30 +0800
committerGitHub <noreply@github.com>2018-11-29 09:46:30 +0800
commit2dc805c0c6e85099f3f346ba78f3a52abf032ce4 (patch)
tree2adeae8beaa207c80908914d3f6e48d82e2ae21d /models/issue_milestone.go
parentd5d847e5c4f0cf1470fc51f96d57917e4d9f5d83 (diff)
downloadgitea-2dc805c0c6e85099f3f346ba78f3a52abf032ce4.tar.gz
gitea-2dc805c0c6e85099f3f346ba78f3a52abf032ce4.zip
Milestone issues and pull requests (#5293)
* add milestone issues and pulls page instead of redirecting issues page * add milestone when creating issue from milestone page * refactor to merge similiar codes as a new function issues * remove milestone info on milestone issues list * fix missing params
Diffstat (limited to 'models/issue_milestone.go')
-rw-r--r--models/issue_milestone.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/models/issue_milestone.go b/models/issue_milestone.go
index 2e512d7ba4..6cb2b6b574 100644
--- a/models/issue_milestone.go
+++ b/models/issue_milestone.go
@@ -122,6 +122,18 @@ func GetMilestoneByRepoID(repoID, id int64) (*Milestone, error) {
return getMilestoneByRepoID(x, repoID, id)
}
+// GetMilestoneByID returns the milestone via id .
+func GetMilestoneByID(id int64) (*Milestone, error) {
+ var m Milestone
+ has, err := x.ID(id).Get(&m)
+ if err != nil {
+ return nil, err
+ } else if !has {
+ return nil, ErrMilestoneNotExist{id, 0}
+ }
+ return &m, nil
+}
+
// MilestoneList is a list of milestones offering additional functionality
type MilestoneList []*Milestone