code.gitea.io/sdk/gitea v0.14.0 -> v0.15.1 (#18186)

This commit is contained in:
6543
2022-01-05 05:51:12 +01:00
committed by GitHub
parent 8760af752a
commit ec6cc38c6c
29 changed files with 695 additions and 133 deletions

View File

@@ -26,8 +26,13 @@ func (o ListOptions) getURLQuery() url.Values {
return query
}
func (o ListOptions) setDefaults() {
if o.Page < 1 {
// setDefaults set default pagination options if none or wrong are set
// if you set -1 as page it will set all to 0
func (o *ListOptions) setDefaults() {
if o.Page < 0 {
o.Page, o.PageSize = 0, 0
return
} else if o.Page == 0 {
o.Page = 1
}