Parcourir la source

Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831) (#11836)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 2b2b3e4c37)
tags/v1.12.0
Cirno the Strongest il y a 4 ans
Parent
révision
56660c3fd0
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4
    1
      models/list_options.go

+ 4
- 1
models/list_options.go Voir le fichier

@@ -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 {

Chargement…
Annuler
Enregistrer