Remote add/update object with relationships in only one transaction
pablorsk opened this issue · comments
Pablo Reyes commented
Hi!
We need add/update relational objects but in just only one transaction.
For example,
var schema = {
type: 'cars',
id: 'string',
attributes: {
name: {presence: true}
},
relationships: {
wheels: {
included: true,
type: 'hasMany'
}
}
}
We need save car
and the wheels
, but if the wheels fail, car
object should not be saved. The server evaluate object as a whole, not as simple parts.
In other words, we need just only one HTTP request for the car
and wheels
.
Of course, the example is for didactic purposes only.
Regards...