diff options
author | 6543 <6543@obermui.de> | 2022-04-25 16:06:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 16:06:24 +0200 |
commit | ddbbe6e15ce411a286c2c9ea4e9fb4107fe3cde5 (patch) | |
tree | 9ec29e551b0a06a3cbc2027aa968d5fc06883a6b /routers/api/v1/repo/issue.go | |
parent | fe274c148bc516b63aa89ab1904d124e60903421 (diff) | |
download | gitea-ddbbe6e15ce411a286c2c9ea4e9fb4107fe3cde5.tar.gz gitea-ddbbe6e15ce411a286c2c9ea4e9fb4107fe3cde5.zip |
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
Diffstat (limited to 'routers/api/v1/repo/issue.go')
-rw-r--r-- | routers/api/v1/repo/issue.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 083fe8f0b9..9654b270c0 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -175,6 +175,7 @@ func SearchIssues(ctx *context.APIContext) { opts.TeamID = team.ID } + repoCond := models.SearchRepositoryCondition(opts) repoIDs, _, err := models.SearchRepositoryIDs(opts) if err != nil { ctx.Error(http.StatusInternalServerError, "SearchRepositoryByName", err) @@ -235,7 +236,7 @@ func SearchIssues(ctx *context.APIContext) { Page: ctx.FormInt("page"), PageSize: limit, }, - RepoIDs: repoIDs, + RepoCond: repoCond, IsClosed: isClosed, IssueIDs: issueIDs, IncludedLabelNames: includedLabelNames, @@ -462,7 +463,7 @@ func ListIssues(ctx *context.APIContext) { if len(keyword) == 0 || len(issueIDs) > 0 || len(labelIDs) > 0 { issuesOpt := &models.IssuesOptions{ ListOptions: listOptions, - RepoIDs: []int64{ctx.Repo.Repository.ID}, + RepoID: ctx.Repo.Repository.ID, IsClosed: isClosed, IssueIDs: issueIDs, LabelIDs: labelIDs, |