1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

[API] Issue Search Add filter for MilestoneNames (#16173)

This commit is contained in:
6543
2021-06-17 08:40:59 +02:00
committed by GitHub
parent fdf9ab11cd
commit 9469e14dc6
4 changed files with 40 additions and 1 deletions

View File

@@ -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 {