fablabbcn / smartcitizen-web

The Smart Citizen Kit platform
https://smartcitizen.me
GNU Affero General Public License v3.0
13 stars 7 forks source link

Code is asking for per_page=1000 but the API default is 25 #411

Closed viktorsmari closed 4 years ago

viktorsmari commented 4 years ago

Expected behaviour

The code is asking the API for 1000 results per page

Actual behaviour

The API only responds with 25 per_page

2019-10-09_09-57-37

How to reproduce?

https://api.smartcitizen.me/v0/kits?per_page=100 You only get 25 results.

In general, is it not bad practice asking for max 1000? What happens we have more than 1000 items? Does the programmer then have to remember to change the code to 2000? And then repeat that cycle?

Edit The url above actually returns 26 results, which is the total number, so it is working fine.

Example: https://api.smartcitizen.me/v0/devices?per_page=100

But should we limit at 1000?