aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@telenet.be>2021-01-17 17:34:19 +0100
committerGitHub <noreply@github.com>2021-01-17 17:34:19 +0100
commitacb1ceb1f426e87e7f821c01ab5b60dad7abc03d (patch)
treedda60238b70b45f7d1bb2f815862c67e82feb048 /routers/api
parent872d3088920f8da2070f497f40d89d35fff9679f (diff)
downloadgitea-acb1ceb1f426e87e7f821c01ab5b60dad7abc03d.tar.gz
gitea-acb1ceb1f426e87e7f821c01ab5b60dad7abc03d.zip
Add review requested filter on pull request overview (#13701)
* Add review requested filter on pull request overview #13682 fix formatting * add review_requested filter to /repos/issues/search API endpoint * only Approve and Reject status should supersede Request status * add support for team reviews * refactor: remove duplication of issue filtering conditions
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/issue.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go
index 25153ad507..bab8f373ce 100644
--- a/routers/api/v1/repo/issue.go
+++ b/routers/api/v1/repo/issue.go
@@ -79,6 +79,10 @@ func SearchIssues(ctx *context.APIContext) {
// in: query
// description: filter (issues / pulls) mentioning you, default is false
// type: boolean
+ // - name: review_requested
+ // in: query
+ // description: filter pulls requesting your review, default is false
+ // type: boolean
// - name: page
// in: query
// description: page number of results to return (1-based)
@@ -204,7 +208,7 @@ func SearchIssues(ctx *context.APIContext) {
UpdatedAfterUnix: since,
}
- // Filter for: Created by User, Assigned to User, Mentioning User
+ // Filter for: Created by User, Assigned to User, Mentioning User, Review of User Requested
if ctx.QueryBool("created") {
issuesOpt.PosterID = ctx.User.ID
}
@@ -214,6 +218,9 @@ func SearchIssues(ctx *context.APIContext) {
if ctx.QueryBool("mentioned") {
issuesOpt.MentionedID = ctx.User.ID
}
+ if ctx.QueryBool("review_requested") {
+ issuesOpt.ReviewRequestedID = ctx.User.ID
+ }
if issues, err = models.Issues(issuesOpt); err != nil {
ctx.Error(http.StatusInternalServerError, "Issues", err)