aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorCirno the Strongest <1447794+CirnoT@users.noreply.github.com>2020-06-10 18:23:22 +0200
committerGitHub <noreply@github.com>2020-06-10 12:23:22 -0400
commit2b2b3e4c3726ef224e87bb444340bebd3a70badb (patch)
tree7297388961a02633c94f21854b3308a06e83441a /models
parentac2304f7a09fbd57adf2962746087d91f90e8692 (diff)
downloadgitea-2b2b3e4c3726ef224e87bb444340bebd3a70badb.tar.gz
gitea-2b2b3e4c3726ef224e87bb444340bebd3a70badb.zip
Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'models')
-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 {