File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,10 @@ func parsePagination(w http.ResponseWriter, r *http.Request) (p codersdk.Paginat
17
17
parser := httpapi .NewQueryParamParser ()
18
18
params := codersdk.Pagination {
19
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" )),
20
+ // A limit of 0 should be interpreted by the SQL query as "null" or
21
+ // "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" )),
22
24
}
23
25
if len (parser .Errors ) > 0 {
24
26
httpapi .Write (ctx , w , http .StatusBadRequest , codersdk.Response {
You can’t perform that action at this time.
0 commit comments