|
|
@ -21,6 +21,7 @@ import ( |
|
|
|
repo_model "code.gitea.io/gitea/models/repo" |
|
|
|
repo_model "code.gitea.io/gitea/models/repo" |
|
|
|
"code.gitea.io/gitea/models/unit" |
|
|
|
"code.gitea.io/gitea/models/unit" |
|
|
|
user_model "code.gitea.io/gitea/models/user" |
|
|
|
user_model "code.gitea.io/gitea/models/user" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/base" |
|
|
|
"code.gitea.io/gitea/modules/git" |
|
|
|
"code.gitea.io/gitea/modules/git" |
|
|
|
"code.gitea.io/gitea/modules/gitrepo" |
|
|
|
"code.gitea.io/gitea/modules/gitrepo" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
@ -96,13 +97,17 @@ func ListPullRequests(ctx *context.APIContext) { |
|
|
|
// "404":
|
|
|
|
// "404":
|
|
|
|
// "$ref": "#/responses/notFound"
|
|
|
|
// "$ref": "#/responses/notFound"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
labelIDs, err := base.StringsToInt64s(ctx.FormStrings("labels")) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
ctx.Error(http.StatusInternalServerError, "PullRequests", err) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
listOptions := utils.GetListOptions(ctx) |
|
|
|
listOptions := utils.GetListOptions(ctx) |
|
|
|
|
|
|
|
|
|
|
|
prs, maxResults, err := issues_model.PullRequests(ctx, ctx.Repo.Repository.ID, &issues_model.PullRequestsOptions{ |
|
|
|
prs, maxResults, err := issues_model.PullRequests(ctx, ctx.Repo.Repository.ID, &issues_model.PullRequestsOptions{ |
|
|
|
ListOptions: listOptions, |
|
|
|
ListOptions: listOptions, |
|
|
|
State: ctx.FormTrim("state"), |
|
|
|
State: ctx.FormTrim("state"), |
|
|
|
SortType: ctx.FormTrim("sort"), |
|
|
|
SortType: ctx.FormTrim("sort"), |
|
|
|
Labels: ctx.FormStrings("labels"), |
|
|
|
Labels: labelIDs, |
|
|
|
MilestoneID: ctx.FormInt64("milestone"), |
|
|
|
MilestoneID: ctx.FormInt64("milestone"), |
|
|
|
}) |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|