cachethq / core

🚦 The core of Cachet, the open-source status page system.
https://cachethq.io
MIT License
102 stars 20 forks source link

API endpoints should always be ordered and filtered correctly #10

Closed jbrooksuk closed 10 months ago

jbrooksuk commented 10 months ago

All index API endpoints should order the results as expected (by default). This also needs to account for filtering for example, hidden component groups.

joelbutcher commented 10 months ago

@jbrooksuk what is the desired default ordering for these endpoints, by ID or by created_at date (should be identical)?

jbrooksuk commented 10 months ago

@joelbutcher IMHO, we should order incidents and metric points from newest to oldest. Everything else should be ascending by ID?

joelbutcher commented 10 months ago

@jbrooksuk it seems all these endpoints are already ordering things correctly. Have added some tests in my branch. What default filters need setting? As far as I can tell, this API is pretty solid already – great job!

jbrooksuk commented 10 months ago

@joelbutcher even for incidents and metrics in newest to oldest?

We should also make sure that you can filter correctly too.