Within my AngularApp, I retrieve data from a WebAPI using OData queries.
All the retrieved results contain both a date and an integer status code. The status codes range from 1 to 4.
I am aiming to organize my results in such a way that all items with a status code of 1 appear at the top of the list. Following this, items with statuses 2, 3, and 4 should be sorted based on their respective dates rather than their status codes.
Is this achievable?
At present, my code is structured as shown below; it only arranges the data by date without considering the status codes:
return Products.query({ $orderby: 'Date' });