summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorCirno the Strongest <1447794+CirnoT@users.noreply.github.com>2020-06-09 15:05:21 +0200
committerGitHub <noreply@github.com>2020-06-09 16:05:21 +0300
commitd06f98d9a2f27e0b3f7c46f5febf04bbe9227351 (patch)
tree58a4734f400fe0f2a2dfd5de35b41c09015003d3 /routers
parentc52f81eecc3e1ad4a4fbf2acba6cae4ffd08a247 (diff)
downloadgitea-d06f98d9a2f27e0b3f7c46f5febf04bbe9227351.tar.gz
gitea-d06f98d9a2f27e0b3f7c46f5febf04bbe9227351.zip
Honor DEFAULT_PAGING_NUM for API (#11805) (#11813)
* 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> (cherry picked from commit cefbf73aea912c510a8dd194532233076b822d37)
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/topic.go6
-rw-r--r--routers/repo/release.go7
2 files changed, 0 insertions, 13 deletions
diff --git a/routers/api/v1/repo/topic.go b/routers/api/v1/repo/topic.go
index 530b92a10d..f256ab9422 100644
--- a/routers/api/v1/repo/topic.go
+++ b/routers/api/v1/repo/topic.go
@@ -275,12 +275,6 @@ func TopicSearch(ctx *context.APIContext) {
kw := ctx.Query("q")
listOptions := utils.GetListOptions(ctx)
- if listOptions.Page < 1 {
- listOptions.Page = 1
- }
- if listOptions.PageSize < 1 {
- listOptions.PageSize = 10
- }
topics, err := models.FindTopics(&models.FindTopicOptions{
Keyword: kw,
diff --git a/routers/repo/release.go b/routers/repo/release.go
index 1eac3dce97..1845563bcf 100644
--- a/routers/repo/release.go
+++ b/routers/repo/release.go
@@ -69,13 +69,6 @@ func Releases(ctx *context.Context) {
IncludeTags: true,
}
- if opts.ListOptions.Page <= 1 {
- opts.ListOptions.Page = 1
- }
- if opts.ListOptions.PageSize <= 0 {
- opts.ListOptions.Page = 10
- }
-
releases, err := models.GetReleasesByRepoID(ctx.Repo.Repository.ID, opts)
if err != nil {
ctx.ServerError("GetReleasesByRepoID", err)