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:
parent
fe274c148b
commit
ddbbe6e15c
8 changed files with 25 additions and 34 deletions
|
@ -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},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue