diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 9b01068e34..3f72d75cf9 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -3479,8 +3479,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 { diff --git a/routers/web/web.go b/routers/web/web.go index df2195e675..d31acc9726 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -1157,10 +1157,8 @@ func registerRoutes(m *web.Route) { m.Group("/{username}/{reponame}", func() { m.Group("", func() { - m.Group("/{type:issues|pulls}", func() { - m.Get("", repo.Issues) - m.Get("/posters", repo.IssuePosters) - }) + m.Get("/issues/posters", repo.IssuePosters) // it can't use {type:issues|pulls} because other routes like "/pulls/{index}" has higher priority + m.Get("/{type:issues|pulls}", repo.Issues) m.Get("/{type:issues|pulls}/{index}", repo.ViewIssue) m.Group("/{type:issues|pulls}/{index}/content-history", func() { m.Get("/overview", repo.GetContentHistoryOverview) @@ -1281,6 +1279,7 @@ func registerRoutes(m *web.Route) { return cancel }) + m.Get("/pulls/posters", repo.PullPosters) m.Group("/pulls/{index}", func() { m.Get(".diff", repo.DownloadPullDiff) m.Get(".patch", repo.DownloadPullPatch)