I have encounterd an error while deleting an Ember data record and I could not figure out why,
Attempted to handle event `pushedData` on <card:32> while in state root.deleted.inFlight.
Error
The code below is where the error get triggered,
deleteBtnClicked() {
const controller = this.controllerFor('browse/index');
let selectedCards = controller.getSelectedCard();
selectedCards = selectedCards.map((card) => {
return parseInt(Ember.get(card, 'id'));
});
selectedCards.forEach((id) => {
this.store.find('card', id)
.then((card) => {
card.destroyRecord();
});
});
}
Turns out the records have been deleted successfuly but the error persists.
Aucun commentaire:
Enregistrer un commentaire