aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-06-17 08:40:59 +0200
committerGitHub <noreply@github.com>2021-06-17 08:40:59 +0200
commit9469e14dc6eb6f2dbd312527ed83d690800a8fc2 (patch)
tree45fb4ed1cdb14ea72f80dfb2ef82226a24433ed4 /models
parentfdf9ab11cd3707ce882756e616955d58d78db8c9 (diff)
downloadgitea-9469e14dc6eb6f2dbd312527ed83d690800a8fc2.tar.gz
gitea-9469e14dc6eb6f2dbd312527ed83d690800a8fc2.zip
[API] Issue Search Add filter for MilestoneNames (#16173)
Diffstat (limited to 'models')
-rw-r--r--models/issue.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index f1a092debd..ffbc110a6b 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1100,6 +1100,7 @@ type IssuesOptions struct {
LabelIDs []int64
IncludedLabelNames []string
ExcludedLabelNames []string
+ IncludeMilestones []string
SortType string
IssueIDs []int64
UpdatedAfterUnix int64
@@ -1241,6 +1242,13 @@ func (opts *IssuesOptions) setupSession(sess *xorm.Session) {
if len(opts.ExcludedLabelNames) > 0 {
sess.And(builder.NotIn("issue.id", BuildLabelNamesIssueIDsCondition(opts.ExcludedLabelNames)))
}
+
+ if len(opts.IncludeMilestones) > 0 {
+ sess.In("issue.milestone_id",
+ builder.Select("id").
+ From("milestone").
+ Where(builder.In("name", opts.IncludeMilestones)))
+ }
}
func applyReposCondition(sess *xorm.Session, repoIDs []int64) *xorm.Session {