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.
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 settingsort: { default: '-createdAt' }
in the message ressource doesn't work either.