1
0
Fork 0
forked from forgejo/forgejo

User specific repoID or xorm builder conditions for issue search (#19475)

* extend models.IssuesOptions to have more specific repo filter options

* use new options

* unrelated refactor

* rm RepoIDs
This commit is contained in:
6543 2022-04-25 16:06:24 +02:00 committed by GitHub
parent fe274c148b
commit ddbbe6e15c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 34 deletions

View file

@ -21,6 +21,7 @@ import (
user_model "code.gitea.io/gitea/models/user"
"github.com/stretchr/testify/assert"
"xorm.io/builder"
)
func TestIssue_ReplaceLabels(t *testing.T) {
@ -157,7 +158,7 @@ func TestIssues(t *testing.T) {
},
{
IssuesOptions{
RepoIDs: []int64{1, 3},
RepoCond: builder.In("repo_id", 1, 3),
SortType: "oldest",
ListOptions: db.ListOptions{
Page: 1,
@ -344,7 +345,7 @@ func TestGetRepoIDsForIssuesOptions(t *testing.T) {
},
{
IssuesOptions{
RepoIDs: []int64{1, 2},
RepoCond: builder.In("repo_id", 1, 2),
},
[]int64{1, 2},
},