diff options
author | Giteabot <teabot@gitea.io> | 2023-07-20 09:38:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-20 13:38:12 +0000 |
commit | 54a516e9daf84e9a2b8b86e36fbed5592b31a758 (patch) | |
tree | 2977d891e9b2484cc79180d9c0f44bb8d8cedabf /routers/web/repo/issue.go | |
parent | ac129d4b4cf40f88f4e348ca9bb1357f7e3d8a84 (diff) | |
download | gitea-54a516e9daf84e9a2b8b86e36fbed5592b31a758.tar.gz gitea-54a516e9daf84e9a2b8b86e36fbed5592b31a758.zip |
Fix the route for pull-request's authors (#26016) (#26018)
Backport #26016 by @wxiaoguang
Close #25906
![image](https://github.com/go-gitea/gitea/assets/2114189/e689f3e1-9a90-46c0-89f4-2d61394d34d3)
Succeeded logs:
```
[I] router: completed GET /root/test/issues/posters?&q=%20&_=1689853025011 for [::1]:59271, 200 OK in 127.7ms @ repo/issue.go:3505(repo.IssuePosters)
[I] router: completed GET /root/test/pulls/posters?&q=%20&_=1689853968204 for [::1]:59269, 200 OK in 94.3ms @ repo/issue.go:3509(repo.PullPosters)
```
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/web/repo/issue.go')
-rw-r--r-- | routers/web/repo/issue.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 4cf319e958..2ad7af050b 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -3476,8 +3476,15 @@ type userSearchResponse struct { // IssuePosters get posters for current repo's issues/pull requests func IssuePosters(ctx *context.Context) { + issuePosters(ctx, false) +} + +func PullPosters(ctx *context.Context) { + issuePosters(ctx, true) +} + +func issuePosters(ctx *context.Context, isPullList bool) { repo := ctx.Repo.Repository - isPullList := ctx.Params(":type") == "pulls" search := strings.TrimSpace(ctx.FormString("q")) posters, err := repo_model.GetIssuePostersWithSearch(ctx, repo, isPullList, search, setting.UI.DefaultShowFullName) if err != nil { |