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>
This commit is contained in:
parent
5734524378
commit
cefbf73aea
5 changed files with 16 additions and 15 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue