Wait to load until currentUser returns

This commit is contained in:
Matthew Dillon 2015-07-10 10:31:07 -08:00
parent eb1a8bb6e3
commit e36d327f36
12 changed files with 85 additions and 84 deletions

View file

@ -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');
},
},