Wait to load until currentUser returns
This commit is contained in:
parent
eb1a8bb6e3
commit
e36d327f36
12 changed files with 85 additions and 84 deletions
|
@ -7,18 +7,18 @@ export default Ember.Controller.extend({
|
|||
|
||||
if (species.get('isDirty')) {
|
||||
species.save().then((species) => {
|
||||
this.transitionToRoute('species.show', species.get('id'));
|
||||
this.transitionToRoute('protected.species.show', species.get('id'));
|
||||
}, (err) => {
|
||||
this.get('flashMessages').error(err.responseJSON.error);
|
||||
});
|
||||
} else {
|
||||
species.deleteRecord();
|
||||
this.transitionToRoute('species.index');
|
||||
this.transitionToRoute('protected.species.index');
|
||||
}
|
||||
},
|
||||
|
||||
cancel: function() {
|
||||
this.transitionToRoute('species.index');
|
||||
this.transitionToRoute('protected.species.index');
|
||||
},
|
||||
|
||||
},
|
||||
|
|
Reference in a new issue