We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18f6bbf commit 6b3f865Copy full SHA for 6b3f865
coderd/pagination.go
@@ -17,8 +17,10 @@ func parsePagination(w http.ResponseWriter, r *http.Request) (p codersdk.Paginat
17
parser := httpapi.NewQueryParamParser()
18
params := codersdk.Pagination{
19
AfterID: parser.UUID(queryParams, uuid.Nil, "after_id"),
20
- Limit: int(parser.PositiveInt32(queryParams, 0, "limit")),
21
- Offset: int(parser.PositiveInt32(queryParams, 0, "offset")),
+ // A limit of 0 should be interpreted by the SQL query as "null" or
+ // "no limit". Do not make this value anything besides 0.
22
+ Limit: int(parser.PositiveInt32(queryParams, 0, "limit")),
23
+ Offset: int(parser.PositiveInt32(queryParams, 0, "offset")),
24
}
25
if len(parser.Errors) > 0 {
26
httpapi.Write(ctx, w, http.StatusBadRequest, codersdk.Response{
0 commit comments