Skip to content

Commit 26bb724

Browse files
CirnoTtechknowlogick
authored and
Yohann Delafollye
committed
Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (go-gitea#11831)
Co-authored-by: techknowlogick <[email protected]>
1 parent 8684090 commit 26bb724

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

models/list_options.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ func (opts ListOptions) setEnginePagination(e Engine) Engine {
3838
}
3939

4040
func (opts ListOptions) setDefaultValues() {
41-
if opts.PageSize <= 0 || opts.PageSize > setting.API.MaxResponseItems {
41+
if opts.PageSize <= 0 {
42+
opts.PageSize = setting.API.DefaultPagingNum
43+
}
44+
if opts.PageSize > setting.API.MaxResponseItems {
4245
opts.PageSize = setting.API.MaxResponseItems
4346
}
4447
if opts.Page <= 0 {

0 commit comments

Comments
 (0)