Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: implement default pagination limit
Specifying no limit should return a default of >0
  • Loading branch information
Emyrk committed Jun 26, 2024
commit 3fda8129e1fb5bef06405c099a3fd5f281d1cee6
2 changes: 1 addition & 1 deletion coderd/pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func parsePagination(w http.ResponseWriter, r *http.Request) (p codersdk.Paginat
parser := httpapi.NewQueryParamParser()
params := codersdk.Pagination{
AfterID: parser.UUID(queryParams, uuid.Nil, "after_id"),
Limit: int(parser.PositiveInt32(queryParams, 0, "limit")),
Limit: int(parser.PositiveInt32(queryParams, 10, "limit")),
Offset: int(parser.PositiveInt32(queryParams, 0, "offset")),
}
if len(parser.Errors) > 0 {
Expand Down