diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-02-05 01:23:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 11:23:46 -0600 |
commit | 3537d80088286880cbf4ba24ac2795dead364253 (patch) | |
tree | caf4f4b6211d20a02deaeb287178aff014c5af00 /routers/repo | |
parent | 80b1d02b2f631a9e68120715a82f7f41f203ef79 (diff) | |
download | gitea-3537d80088286880cbf4ba24ac2795dead364253.tar.gz gitea-3537d80088286880cbf4ba24ac2795dead364253.zip |
Fix bug about ListOptions and stars/watchers pagnation (#14556)
* Fix bug about ListOptions and stars/watchers pagnation
* fix unit test
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/view.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index 25d40c34d8..45f17dee44 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -713,7 +713,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 @@ -744,6 +747,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) |