Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 2b2b3e4c37
)
tags/v1.12.0
} | } | ||||
func (opts ListOptions) setDefaultValues() { | 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 | opts.PageSize = setting.API.MaxResponseItems | ||||
} | } | ||||
if opts.Page <= 0 { | if opts.Page <= 0 { |