diff options
Diffstat (limited to 'routers/repo/milestone.go')
-rw-r--r-- | routers/repo/milestone.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/routers/repo/milestone.go b/routers/repo/milestone.go index 9d8f34268d..0bd7344878 100644 --- a/routers/repo/milestone.go +++ b/routers/repo/milestone.go @@ -13,6 +13,7 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/markup/markdown" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/util" @@ -47,13 +48,24 @@ func Milestones(ctx *context.Context) { } var total int + var state structs.StateType if !isShowClosed { total = int(stats.OpenCount) + state = structs.StateOpen } else { total = int(stats.ClosedCount) + state = structs.StateClosed } - miles, err := models.GetMilestones(ctx.Repo.Repository.ID, page, isShowClosed, sortType) + miles, err := models.GetMilestones(models.GetMilestonesOption{ + ListOptions: models.ListOptions{ + Page: page, + PageSize: setting.UI.IssuePagingNum, + }, + RepoID: ctx.Repo.Repository.ID, + State: state, + SortType: sortType, + }) if err != nil { ctx.ServerError("GetMilestones", err) return |