medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
26.23k stars 2.67k forks source link

API Ref(admin): Issue in List Orders #6690

Closed BorisKamp closed 8 months ago

BorisKamp commented 8 months ago

Preliminary Checks

Issue Summary

I did not find how to specify the sort in combination with the order. I had to dive in the code to find this comment line: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with '-'. in @medusajs/medusa/dist/api/routes/admin/orders/list-orders.d.ts to figure out I need to prefix with - or not.

Would be nice if this is documented in the API docs in the param description! And does'nt hurt to mention how to order on nested data, if this is possible at all, for example: customer.first_name.

How can this issue be resolved?

Make the docs clearer

Are you interested in working on this issue?

shahednasser commented 8 months ago

Hello, thank you for your input! We actually do mention this under the Pagination section. You'll find a sort order sub-section with details on this.

BorisKamp commented 8 months ago

Hello, thank you for your input! We actually do mention this under the Pagination section. You'll find a sort order sub-section with details on this.

Ah I see, well it doesn't hurt to link to that pagination section from other parts of the API docs right? And what about nested relational fields like in my example above?