Rename contributorId to recipientId #199

Merged
raucao merged 7 commits from chore/rename_recipient_for_reimbursements into master 2022-06-12 05:17:48 +00:00
3 changed files with 7 additions and 7 deletions
Showing only changes of commit 721c330f3c - Show all commits
@@ -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,
+2 -2
View File
@@ -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
});
+1 -1
View File
@@ -10,7 +10,7 @@ export default function processReimbursementData(data) {
}
const otherProperties = [
'id', 'contributorId', 'token', 'vetoed', 'ipfsHash',
'id', 'recipientId', 'token', 'vetoed', 'ipfsHash',
'expenses', 'pendingTx'
];