typicode / json-server

Get a full fake REST API with zero coding in less than 30 seconds (seriously)
Other
72.67k stars 7.01k forks source link

conditional operators doesn't work #1536

Open bockster6669 opened 6 months ago

bockster6669 commented 6 months ago

When I use _gte and _lte the query doesn't respond with the correct data. If I use them separately, they works, but if I apply something like "carList?price_gte=1000&price_lte=5000" it doesnt respond with the correct data

rkdarling898 commented 4 months ago

I know this is a bit late but I dug into this and it has to do with the full url not being parsed. In my case the get route was only taking in the first parameter and causing the result to be only that. After a bit too long, I just wrapped the url in quotations and it worked just fine.

Example: curl "http://localhost:3000/cars?price_gte=900&price_lte=5000"