Skip to content

Commit b6fe6b6

Browse files
committed
Properly filter issue list given no assignees filter
1 parent df805d6 commit b6fe6b6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/indexer/issues/dboptions.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOp
4444
searchOpt.ProjectID = optional.Some[int64](0) // Those issues with no project(projectid==0)
4545
}
4646

47+
if opts.AssigneeID > 0 {
48+
searchOpt.AssigneeID = optional.Some(opts.AssigneeID)
49+
} else if opts.AssigneeID == -1 { // FIXME: this is inconsistent from other places
50+
searchOpt.AssigneeID = optional.Some[int64](0)
51+
}
52+
4753
// See the comment of issues_model.SearchOptions for the reason why we need to convert
4854
convertID := func(id int64) optional.Option[int64] {
4955
if id > 0 {
@@ -57,7 +63,6 @@ func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOp
5763

5864
searchOpt.ProjectColumnID = convertID(opts.ProjectColumnID)
5965
searchOpt.PosterID = convertID(opts.PosterID)
60-
searchOpt.AssigneeID = convertID(opts.AssigneeID)
6166
searchOpt.MentionID = convertID(opts.MentionedID)
6267
searchOpt.ReviewedID = convertID(opts.ReviewedID)
6368
searchOpt.ReviewRequestedID = convertID(opts.ReviewRequestedID)

0 commit comments

Comments
 (0)