Prevent transition abortion on contributor save

This commit is contained in:
2019-09-18 09:32:57 +02:00
parent 985e1673ac
commit f272bcfcbc
3 changed files with 4 additions and 6 deletions
@@ -8,6 +8,7 @@ import { isAddress } from 'web3-utils';
export default Component.extend({ export default Component.extend({
kredits: service(), kredits: service(),
router: service(),
attributes: null, attributes: null,
@@ -75,6 +76,7 @@ export default Component.extend({
window.alert('Something went wrong. Please check the browser console.'); window.alert('Something went wrong. Please check the browser console.');
}).finally(() => { }).finally(() => {
this.set('inProgress', false); this.set('inProgress', false);
this.router.transitionTo('dashboard');
}); });
} }
+1 -3
View File
@@ -8,9 +8,7 @@ export default Controller.extend({
actions: { actions: {
save (attributes) { save (attributes) {
return this.kredits return this.kredits.updateContributor(this.model.id, attributes);
.updateContributor(this.model.id, attributes)
.then(() => this.transitionToRoute('index'))
} }
} }
+1 -3
View File
@@ -8,9 +8,7 @@ export default Controller.extend({
actions: { actions: {
save (contributor) { save (contributor) {
return this.kredits return this.kredits.addContributor(contributor);
.addContributor(contributor)
.then(() => this.transitionToRoute('index'))
} }
} }