1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-01 23:28:36 +00:00

Fix bug about ListOptions and stars/watchers pagnation (#14556) (#14573)

* Fix bug about ListOptions and stars/watchers pagnation

* fix unit test
This commit is contained in:
6543
2021-02-05 22:11:15 +01:00
committed by GitHub
parent da7a525c5c
commit d0174d45ed
3 changed files with 11 additions and 7 deletions

View File

@@ -692,7 +692,10 @@ func RenderUserCards(ctx *context.Context, total int, getter func(opts models.Li
pager := context.NewPagination(total, models.ItemsPerPage, page, 5)
ctx.Data["Page"] = pager
items, err := getter(models.ListOptions{Page: pager.Paginater.Current()})
items, err := getter(models.ListOptions{
Page: pager.Paginater.Current(),
PageSize: models.ItemsPerPage,
})
if err != nil {
ctx.ServerError("getter", err)
return
@@ -723,6 +726,7 @@ func Stars(ctx *context.Context) {
func Forks(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repos.forks")
// TODO: need pagination
forks, err := ctx.Repo.Repository.GetForks(models.ListOptions{})
if err != nil {
ctx.ServerError("GetForks", err)