Search code examples
reactjsapi-designecmascript-2016

Should a view be ordering data?


I have data coming from an API not in order and this is affecting my front-ends ordering, I am thinking what the most correct way to fix this issue is.

Should I be expecting the correct data to come from my api and use that as it is or should I be sorting data on the front-end?

So what I am asking in terms of software practices what's the right way to do this?


Solution

  • The API should provide a way to sort the data that's being returned. If you sort on the front end, proper pagination becomes nightmarish.