diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index c65f4b7063a..9afde1f5ed0 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -40,13 +40,14 @@ func ListIssues(ctx *context.APIContext) { issues = append(issues, tempIssues...) } - // FIXME: use IssueList to improve performance. + err = models.IssueList(issues).LoadAttributes() + if err != nil { + ctx.Error(500, "LoadAttributes", err) + return + } + apiIssues := make([]*api.Issue, len(issues)) for i := range issues { - if err = issues[i].LoadAttributes(); err != nil { - ctx.Error(500, "LoadAttributes", err) - return - } apiIssues[i] = issues[i].APIFormat() }