I have a model favorite
. In the UI it is possible to drag and reorder these favortes.
When updating the order, i want to save this to the API. Is it possible to save multiple favorites by sending 1 request to the API? By default 1 request per favorite is send on favorite.save()
.
What I want is 1 PUT request formated something like this:
// PUT /api/users/1/favorites
// or
// PUT /api/favorites
{
"favorites": [
{
"id": 2,
"order": 1
}, {
"id": 5,
"order": 2
}, {
"id": 12,
"order": 3
}
]
}