Hi,
I encountered an issue with the card-listing API.
Steps to reproduce
- Create an empty deck.
- Request its cards:
GET /api/cards/?deck-id=&limit=100
- The response contains:
{ "docs": [], "bookmark": "nil" }
- Following that bookmark:
GET /api/cards/?deck-id=&limit=100&bookmark=nil
returns:
HTTP 500
{"errors":["Something went wrong."]}
Expected behavior
For an empty or final page, the API should ideally return a missing, null, or empty bookmark. Alternatively, passing the returned "nil" bookmark should produce an empty page rather than an HTTP 500.
This makes generic pagination loops fail unless they explicitly treat the string "nil" as a terminal value.
Thanks!