Skip to content

Instantly share code, notes, and snippets.

@gordonbisnor
Created November 27, 2019 17:40
Show Gist options
  • Save gordonbisnor/80ce32d2bf85a570340b32bd4f78ecae to your computer and use it in GitHub Desktop.
Save gordonbisnor/80ce32d2bf85a570340b32bd4f78ecae to your computer and use it in GitHub Desktop.
import Mixin from '@ember/object/mixin';
export default Mixin.create({
isShowingDeleteConfirmation: false,
actions: {
requestDelete() {
this.toggleProperty('isShowingDeleteConfirmation');
},
cancelDelete() {
this.toggleProperty('isShowingDeleteConfirmation');
},
delete(item) {
this.toggleProperty('isShowingDeleteConfirmation');
item.destroyRecord().then( () => {
let p = this.get('parentRoute');
this.transitionToRoute(p);
});
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment