aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index e3ba5692c4..b3af6705ca 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -360,8 +360,11 @@ func Issues(ctx *context.Context) {
issues(ctx, ctx.QueryInt64("milestone"), util.OptionalBoolOf(isPullList))
var err error
- // Get milestones.
- ctx.Data["Milestones"], err = models.GetMilestonesByRepoID(ctx.Repo.Repository.ID, api.StateType(ctx.Query("state")), models.ListOptions{})
+ // Get milestones
+ ctx.Data["Milestones"], err = models.GetMilestones(models.GetMilestonesOption{
+ RepoID: ctx.Repo.Repository.ID,
+ State: api.StateType(ctx.Query("state")),
+ })
if err != nil {
ctx.ServerError("GetAllRepoMilestones", err)
return
@@ -375,12 +378,18 @@ func Issues(ctx *context.Context) {
// RetrieveRepoMilestonesAndAssignees find all the milestones and assignees of a repository
func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *models.Repository) {
var err error
- ctx.Data["OpenMilestones"], err = models.GetMilestones(repo.ID, -1, false, "")
+ ctx.Data["OpenMilestones"], err = models.GetMilestones(models.GetMilestonesOption{
+ RepoID: repo.ID,
+ State: api.StateOpen,
+ })
if err != nil {
ctx.ServerError("GetMilestones", err)
return
}
- ctx.Data["ClosedMilestones"], err = models.GetMilestones(repo.ID, -1, true, "")
+ ctx.Data["ClosedMilestones"], err = models.GetMilestones(models.GetMilestonesOption{
+ RepoID: repo.ID,
+ State: api.StateClosed,
+ })
if err != nil {
ctx.ServerError("GetMilestones", err)
return