diff --git a/app/components/add-reimbursement/component.js b/app/components/add-reimbursement/component.js index ca2c5a4..f74d738 100644 --- a/app/components/add-reimbursement/component.js +++ b/app/components/add-reimbursement/component.js @@ -15,7 +15,7 @@ export default class AddReimbursementComponent extends Component { @alias('kredits.contributorsSorted') contributors; - @tracked contributorId = null; + @tracked recipientId = null; @tracked title = ''; @tracked total = '0'; @tracked expenses = A([]); @@ -86,7 +86,7 @@ export default class AddReimbursementComponent extends Component { @action updateContributor(event) { - this.contributorId = event.target.value; + this.recipientId = event.target.value; } @action @@ -118,12 +118,12 @@ export default class AddReimbursementComponent extends Component { if (!this.kredits.currentUser) { window.alert('You need to connect your Ethereum account first.'); return false } if (!this.kredits.currentUserIsCore) { window.alert('Only core contributors can submit reimbursements.'); return false } - const contributor = this.contributors.findBy('id', this.contributorId); + const contributor = this.contributors.findBy('id', this.recipientId); const attributes = { amount: parseInt(parseFloat(this.total) * 100000000), // convert to sats token: config.tokens['WBTC'], - contributorId: parseInt(this.contributorId), + recipientId: parseInt(this.recipientId), title: `Expenses covered by ${contributor.name}`, description: this.description, url: this.url, diff --git a/app/services/kredits.js b/app/services/kredits.js index 776b7d0..23a4b0f 100644 --- a/app/services/kredits.js +++ b/app/services/kredits.js @@ -575,7 +575,7 @@ export default Service.extend({ loadReimbursementFromData(data) { const obj = Reimbursement.create(processReimbursementData(data)); - obj.set('contributor', this.contributors.findBy('id', data.contributorId.toString())); + obj.set('contributor', this.contributors.findBy('id', data.recipientId.toString())); this.removeObjectFromCollectionIfLoaded('reimbursements', obj.id); this.reimbursements.pushObject(obj); return obj; @@ -589,7 +589,7 @@ export default Service.extend({ console.debug('[kredits] add reimbursement response', data); const reimbursement = Reimbursement.create(attributes); reimbursement.setProperties({ - contributor: this.contributors.findBy('id', attributes.contributorId.toString()), + contributor: this.contributors.findBy('id', attributes.recipientId.toString()), pendingTx: data, confirmedAt: this.currentBlock + 40320 }); diff --git a/app/utils/process-reimbursement-data.js b/app/utils/process-reimbursement-data.js index a66287c..3586194 100644 --- a/app/utils/process-reimbursement-data.js +++ b/app/utils/process-reimbursement-data.js @@ -10,7 +10,7 @@ export default function processReimbursementData(data) { } const otherProperties = [ - 'id', 'contributorId', 'token', 'vetoed', 'ipfsHash', + 'id', 'recipientId', 'token', 'vetoed', 'ipfsHash', 'expenses', 'pendingTx' ];