epilogue
epilogue copied to clipboard
Order of associations
If I have a Discussion model plugged to a Message model through an hasMany relationship, how should I proceed to retrieve a specific discussion with its messages sorted in a particular order?
Setting a defaultScope with an { order: [['createdAt', 'DESC]] }
on the Message model doesn't work, and setting sort: { default: '-createdAt' }
in the message ressource doesn't work either.
Looks like I created the same sort of issue here: https://github.com/dchester/epilogue/issues/235
I did however provide an example, which may help demonstrate the issue better.