Skip to content

Commit

Permalink
feat: Confirm before account deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
courajs committed Jun 1, 2016
1 parent ee3ee74 commit 7164a05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/account/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ export default Route.extend({

actions: {
deleteAccount(account) {
get(this, 'accountAdmin.accounts').remove(account.id)
.then(() => {
this.transitionTo('accounts');
});
if (confirm(`Are you sure you'd like to delete ${account.username}'s account?`)) {
get(this, 'accountAdmin.accounts').remove(account.id)
.then(() => {
this.transitionTo('accounts');
});
}
}
}
});

0 comments on commit 7164a05

Please sign in to comment.