diff options
author | Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> | 2020-06-10 19:42:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 13:42:10 -0400 |
commit | 56660c3fd006a1c5ef84880fe35dd90a6fc7ee96 (patch) | |
tree | e0f58da693fb0949e1367dec5d46e532baca8ef4 | |
parent | 87a82138c62769b435419fb4a1a37aaaf89e4f98 (diff) | |
download | gitea-56660c3fd006a1c5ef84880fe35dd90a6fc7ee96.tar.gz gitea-56660c3fd006a1c5ef84880fe35dd90a6fc7ee96.zip |
Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831) (#11836)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 2b2b3e4c3726ef224e87bb444340bebd3a70badb)
-rw-r--r-- | models/list_options.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/models/list_options.go b/models/list_options.go index 0946917fec..62c0944cc8 100644 --- a/models/list_options.go +++ b/models/list_options.go @@ -38,7 +38,10 @@ func (opts ListOptions) setEnginePagination(e Engine) Engine { } func (opts ListOptions) setDefaultValues() { - if opts.PageSize <= 0 || opts.PageSize > setting.API.MaxResponseItems { + if opts.PageSize <= 0 { + opts.PageSize = setting.API.DefaultPagingNum + } + if opts.PageSize > setting.API.MaxResponseItems { opts.PageSize = setting.API.MaxResponseItems } if opts.Page <= 0 { |