File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,16 @@ type PullRequestsOptions struct {
2828 Labels []int64
2929 MilestoneID int64
3030 PosterID int64
31+ BaseBranch string
3132}
3233
3334func listPullRequestStatement (ctx context.Context , baseRepoID int64 , opts * PullRequestsOptions ) * xorm.Session {
3435 sess := db .GetEngine (ctx ).Where ("pull_request.base_repo_id=?" , baseRepoID )
3536
37+ if len (opts .BaseBranch ) > 0 {
38+ sess .And ("pull_request.base_branch=?" , opts .BaseBranch )
39+ }
40+
3641 sess .Join ("INNER" , "issue" , "pull_request.issue_id = issue.id" )
3742 switch opts .State {
3843 case "closed" , "open" :
Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ func ListPullRequests(ctx *context.APIContext) {
5959 // description: Name of the repo
6060 // type: string
6161 // required: true
62+ // - name: base_branch
63+ // in: query
64+ // description: Filter by target base branch of the pull request
65+ // type: string
6266 // - name: state
6367 // in: query
6468 // description: State of pull request
@@ -132,6 +136,7 @@ func ListPullRequests(ctx *context.APIContext) {
132136 Labels : labelIDs ,
133137 MilestoneID : ctx .FormInt64 ("milestone" ),
134138 PosterID : posterID ,
139+ BaseBranch : ctx .FormTrim ("base_branch" ),
135140 })
136141 if err != nil {
137142 ctx .APIErrorInternal (err )
You can’t perform that action at this time.
0 commit comments