Update Ember to 3.1
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
export default Controller.extend({
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Controller from 'ember-controller';
|
||||
import { alias, filter, filterBy, sort } from 'ember-computed';
|
||||
import injectService from 'ember-service/inject';
|
||||
import Controller from '@ember/controller';
|
||||
import { alias, filter, filterBy, sort } from '@ember/object/computed';
|
||||
import { inject as injectService } from '@ember/service';
|
||||
|
||||
export default Controller.extend({
|
||||
kredits: injectService(),
|
||||
@@ -21,15 +21,15 @@ export default Controller.extend({
|
||||
|
||||
actions: {
|
||||
confirmProposal(proposalId) {
|
||||
this.get('kredits').vote(proposalId).then(transaction => {
|
||||
this.kredits.vote(proposalId).then(transaction => {
|
||||
window.confirm('Vote submitted to Ethereum blockhain: '+transaction.hash);
|
||||
});
|
||||
},
|
||||
|
||||
save(contributor) {
|
||||
return this.get('kredits').addContributor(contributor)
|
||||
return this.kredits.addContributor(contributor)
|
||||
.then((contributor) => {
|
||||
this.get('contributors').pushObject(contributor);
|
||||
this.contributors.pushObject(contributor);
|
||||
return contributor;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Controller from 'ember-controller';
|
||||
import { alias, filterBy } from 'ember-computed';
|
||||
import injectService from 'ember-service/inject';
|
||||
import Controller from '@ember/controller';
|
||||
import { alias, filterBy } from '@ember/object/computed';
|
||||
import { inject as injectService } from '@ember/service';
|
||||
|
||||
export default Controller.extend({
|
||||
kredits: injectService(),
|
||||
@@ -11,10 +11,10 @@ export default Controller.extend({
|
||||
actions: {
|
||||
save(proposal) {
|
||||
// contributorIpfsHash is needed for the proposal ipfs data. I'm not happy to do this here but I think to load all the contributors in addProposal again is a bit too much. I hope we can refactor it later.
|
||||
let contributor = this.get('contributors').findBy('id', proposal.contributorId);
|
||||
let contributor = this.contributors.findBy('id', proposal.contributorId);
|
||||
proposal.contributorIpfsHash = contributor.get('ipfsHash');
|
||||
|
||||
return this.get('kredits').addProposal(proposal)
|
||||
return this.kredits.addProposal(proposal)
|
||||
.then((proposal) => {
|
||||
this.transitionToRoute('index');
|
||||
return proposal;
|
||||
|
||||
Reference in New Issue
Block a user