Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions routers/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -1143,10 +1143,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)
Expand Down Expand Up @@ -1267,6 +1265,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)
Expand Down