aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorCirno the Strongest <1447794+CirnoT@users.noreply.github.com>2020-06-09 04:46:51 +0200
committerGitHub <noreply@github.com>2020-06-08 22:46:51 -0400
commitcefbf73aea912c510a8dd194532233076b822d37 (patch)
treee75a011b7563a27e572f4f93670367589fea09fd /modules
parent5734524378f9388b7a7466445b0b339e2837a5d8 (diff)
downloadgitea-cefbf73aea912c510a8dd194532233076b822d37.tar.gz
gitea-cefbf73aea912c510a8dd194532233076b822d37.zip
Honor DEFAULT_PAGING_NUM for API (#11805)
* Honor DEFAULT_PAGING_NUM for API * set pagination to 10 for tests * lint Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/convert/utils.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/convert/utils.go b/modules/convert/utils.go
index 66fb21be67..ddb8a8820d 100644
--- a/modules/convert/utils.go
+++ b/modules/convert/utils.go
@@ -11,7 +11,7 @@ import (
// ToCorrectPageSize makes sure page size is in allowed range.
func ToCorrectPageSize(size int) int {
if size <= 0 {
- size = 10
+ size = setting.API.DefaultPagingNum
} else if size > setting.API.MaxResponseItems {
size = setting.API.MaxResponseItems
}