OriginProtocol / origin-bridge

We've moved to a monorepo: https://github.com/OriginProtocol/origin/tree/master/infra/bridge
MIT License
15 stars 7 forks source link

Pagination: Listings #99

Closed micahalcorn closed 6 years ago

micahalcorn commented 6 years ago

A request for all listings should not actually yield all of them. There should be a default limit (maybe 10?) with a maximum limit (maybe 100?). Other parameters might include the starting position and/or ending position for the "page" and the response should probably indicate whether or not there are more results to retrieve in a subsequent request.

lucadgtrip commented 6 years ago

just as a data point the main platforms have moved away from the standard 10 listings per page to:

franckc commented 6 years ago

Here is the relevant Flask restless documentation regarding pagination: https://flask-restless.readthedocs.io/en/stable/requestformat.html#pagination

Currently our listing, purchase and review Flask Restless endpoints have a fixed page size of 10 entries. See https://github.com/OriginProtocol/origin-bridge/blob/develop/app/app_config.py#L41

I'd suggest we change the current behavior for listing, purchase and review endpoints to the following:

Tagging issues #100 and #101 since this comment is relevant to those.

sparrowDom commented 6 years ago

See the solution here: https://github.com/OriginProtocol/origin-bridge/pull/129

And all that was needed were 3 lines of code.