Merge branch 'master' into feature/store-models-in-service

# Conflicts:
#	app/controllers/index.js
#	tests/unit/controllers/index-test.js
This commit is contained in:
2018-04-15 20:23:39 +02:00
11 changed files with 53 additions and 34 deletions
+4 -5
View File
@@ -42,10 +42,9 @@ export default Controller.extend({
this.get('proposals').pushObject(proposal);
},
_handleProposalExecuted(proposalId, recipientId, amount) {
// TODO: check if proposalId is already a string
_handleProposalExecuted(proposalId, contributorId, amount) {
let proposal = this.get('proposals')
.findBy('id', proposalId.toString());
.findBy('id', proposalId);
if (proposal.get('isExecuted')) {
Ember.Logger.debug('[index] proposal already executed, not adding from event');
@@ -57,13 +56,13 @@ export default Controller.extend({
});
this.get('contributors')
.findBy('id', recipientId.toString())
.findBy('id', contributorId)
.incrementProperty('balance', amount);
},
_handleProposalVoted(proposalId, voter, totalVotes) {
this.get('proposals')
.findBy('id', proposalId.toString())
.findBy('id', proposalId)
.setProperties({ 'votesCount': totalVotes });
},