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

_sort=price&_order=asc no longer working #1541

Open iamdebobrota opened 5 months ago

iamdebobrota commented 5 months ago

Its not support the _order query

horizoncarlo commented 4 months ago

I noticed this too. It's not hugely spelled out in the new 1.0-alpha docs, but the approach changed a bit: https://www.npmjs.com/package/json-server#sort

Basically for your example you'd use _sort=price for ascending, and _sort=-price for descending (note the dash prefix). No _order needed or used anymore from what I can see.

AnyLifeZLB commented 4 months ago

I have the same problem 😭

json-server --version 1.0.0-beta.0