From 2b2b3e4c3726ef224e87bb444340bebd3a70badb Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Wed, 10 Jun 2020 18:23:22 +0200 Subject: [PATCH] Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831) Co-authored-by: techknowlogick --- models/list_options.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 {