1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00:00

Allow filtering PRs by poster in the ListPullRequests API (#32209)

as title

---
*Sponsored by Kithara Software GmbH*
This commit is contained in:
6543
2024-10-07 23:21:07 +02:00
committed by GitHub
parent fa35ace9fb
commit bdd655f2bd
3 changed files with 57 additions and 15 deletions

View File

@ -26,6 +26,7 @@ type PullRequestsOptions struct {
SortType string
Labels []int64
MilestoneID int64
PosterID int64
}
func listPullRequestStatement(ctx context.Context, baseRepoID int64, opts *PullRequestsOptions) *xorm.Session {
@ -46,6 +47,10 @@ func listPullRequestStatement(ctx context.Context, baseRepoID int64, opts *PullR
sess.And("issue.milestone_id=?", opts.MilestoneID)
}
if opts.PosterID > 0 {
sess.And("issue.poster_id=?", opts.PosterID)
}
return sess
}