Open dimoreira opened 7 years ago
The primary
data should remain in the same order. Are you referring to the included
data?
The primary
data that is reordering basically because the simple way that browsers reshuffle object keys. Try this on Chrome console: {12: 'a', 2: 'b'}
This is the way my team solved the problem: https://github.com/redvulps/jsonapi-datastore/commit/75bba57bd04e19b38be91f2a183b235093d08d2f
That is some interesting information I was not aware of. Keeping the same order should be the default (and probably only) behavior IMO. Would you mind issuing a PR?
@redvulps Could you send a PR to the main repo when you have time?
hm, should we keep the current behavior as default? or return the same sorting as in the request as default?
@redvulps I would favor returning the same sorting as in the request only. The current behavior is in fact undefined.
I too experienced this problem. How can i solve this problem?
When requesting an ordered endpoint of my API by some custom order field (like:
updated_at DESC
), my results gets reordered by id when parsed by the library.There is some way to not reorder the results, just parse them in the order they appear in the API response?