summaryrefslogtreecommitdiffstats
path: root/routers
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 /routers
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 '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)