summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCirno the Strongest <1447794+CirnoT@users.noreply.github.com>2020-06-10 19:42:10 +0200
committerGitHub <noreply@github.com>2020-06-10 13:42:10 -0400
commit56660c3fd006a1c5ef84880fe35dd90a6fc7ee96 (patch)
treee0f58da693fb0949e1367dec5d46e532baca8ef4
parent87a82138c62769b435419fb4a1a37aaaf89e4f98 (diff)
downloadgitea-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.go5
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 {