[API] Issue Search Add filter for MilestoneNames (#16173)
This commit is contained in:
parent
fdf9ab11cd
commit
9469e14dc6
4 changed files with 40 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue