mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix: Adjust pagination limit to be zero-based (#2663)
There isn't a use-case for querying a limit of zero. Using -1 led to issues when using default parameters for querying.
This commit is contained in:
@ -17,7 +17,7 @@ func parsePagination(w http.ResponseWriter, r *http.Request) (p codersdk.Paginat
|
||||
params := codersdk.Pagination{
|
||||
AfterID: parser.UUID(queryParams, uuid.Nil, "after_id"),
|
||||
// Limit default to "-1" which returns all results
|
||||
Limit: parser.Int(queryParams, -1, "limit"),
|
||||
Limit: parser.Int(queryParams, 0, "limit"),
|
||||
Offset: parser.Int(queryParams, 0, "offset"),
|
||||
}
|
||||
if len(parser.Errors) > 0 {
|
||||
|
Reference in New Issue
Block a user