GitHub API Compliance (& linting)
This commit is contained in:
@ -17,14 +17,26 @@ import (
|
||||
|
||||
// ListIssues list the issues of a repository
|
||||
func ListIssues(ctx *context.APIContext) {
|
||||
issues, err := models.Issues(&models.IssuesOptions{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Page: ctx.QueryInt("page"),
|
||||
})
|
||||
issueOpts := models.IssuesOptions{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Page: ctx.QueryInt("page"),
|
||||
IsClosed: ctx.Query("state") == "closed",
|
||||
}
|
||||
|
||||
issues, err := models.Issues(&issueOpts)
|
||||
if err != nil {
|
||||
ctx.Error(500, "Issues", err)
|
||||
return
|
||||
}
|
||||
if ctx.Query("state") == "all" {
|
||||
issueOpts.IsClosed = !issueOpts.IsClosed
|
||||
temp_issues, err := models.Issues(&issueOpts)
|
||||
if err != nil {
|
||||
ctx.Error(500, "Issues", err)
|
||||
return
|
||||
}
|
||||
issues = append(issues, temp_issues...)
|
||||
}
|
||||
|
||||
// FIXME: use IssueList to improve performance.
|
||||
apiIssues := make([]*api.Issue, len(issues))
|
||||
|
Reference in New Issue
Block a user