diff options
author | Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> | 2020-06-09 15:05:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-09 16:05:21 +0300 |
commit | d06f98d9a2f27e0b3f7c46f5febf04bbe9227351 (patch) | |
tree | 58a4734f400fe0f2a2dfd5de35b41c09015003d3 /routers | |
parent | c52f81eecc3e1ad4a4fbf2acba6cae4ffd08a247 (diff) | |
download | gitea-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.go | 6 | ||||
-rw-r--r-- | routers/repo/release.go | 7 |
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) |