Rename recipientId to contributorId in proposals
This commit is contained in:
@@ -26,7 +26,7 @@ export default Controller.extend({
|
||||
return this.get('model.proposals')
|
||||
.map((proposal) => {
|
||||
let contributor = this.get('contributors')
|
||||
.findBy('id', proposal.get('recipientId'));
|
||||
.findBy('id', proposal.get('contributorId'));
|
||||
|
||||
proposal.set('contributor', contributor);
|
||||
|
||||
@@ -51,9 +51,9 @@ export default Controller.extend({
|
||||
this.get('proposals').pushObject(proposal);
|
||||
},
|
||||
|
||||
_handleProposalExecuted(proposalId, recipientId, amount) {
|
||||
_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');
|
||||
@@ -65,13 +65,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 });
|
||||
},
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ 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.recipientId);
|
||||
let contributor = this.get('contributors').findBy('id', proposal.contributorId);
|
||||
proposal.contributorIpfsHash = contributor.get('ipfsHash');
|
||||
|
||||
return this.get('kredits').addProposal(proposal)
|
||||
|
||||
Reference in New Issue
Block a user