mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 19:12:25 -05:00
[bugfix] Return all accounts when list accounts limit <= 0 (#2014)
This commit is contained in:
parent
d6fa74e5dc
commit
89ee9d5004
6 changed files with 451 additions and 23 deletions
|
|
@ -27,11 +27,12 @@ import (
|
|||
const (
|
||||
/* Common keys */
|
||||
|
||||
IDKey = "id"
|
||||
LimitKey = "limit"
|
||||
LocalKey = "local"
|
||||
MaxIDKey = "max_id"
|
||||
MinIDKey = "min_id"
|
||||
IDKey = "id"
|
||||
LimitKey = "limit"
|
||||
LocalKey = "local"
|
||||
MaxIDKey = "max_id"
|
||||
SinceIDKey = "since_id"
|
||||
MinIDKey = "min_id"
|
||||
|
||||
/* Search keys */
|
||||
|
||||
|
|
@ -76,10 +77,8 @@ func ParseLimit(value string, defaultValue int, max, min int) (int, gtserror.Wit
|
|||
i, err := parseInt(value, defaultValue, max, min, LimitKey)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
} else if i == 0 {
|
||||
// treat 0 as an empty query
|
||||
return defaultValue, nil
|
||||
}
|
||||
|
||||
return i, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue