Rename contributorId to recipientId #199
@@ -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,
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ export default function processReimbursementData(data) {
|
||||
}
|
||||
|
||||
const otherProperties = [
|
||||
'id', 'contributorId', 'token', 'vetoed', 'ipfsHash',
|
||||
'id', 'recipientId', 'token', 'vetoed', 'ipfsHash',
|
||||
'expenses', 'pendingTx'
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user