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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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
}