@leondmello wrote:
Suppose I have two models,
parentandchildwhich share abelongsTorelationship.models/parent.js { child: belongsTo('') } models/child.js { parent: belongsTo('') }In one of my controllers, I want to destroy the two records, so I have code which does something like,
model.get('child').destroyRecord() .then(() => { model.destroyRecord(); });How do I revert the delete on the child if the parent's
model.destroyRecord()fails?
What is the preferred approach to revert dependent relationship deletes?
Posts: 2
Participants: 2