🐛 (Refund Transaction) Fix toMe & fromMe variables

This commit is contained in:
Julien Calixte
2019-10-01 21:50:57 +02:00
parent 5307d2383c
commit 228198363e
2 changed files with 15 additions and 7 deletions

View File

@@ -6,25 +6,33 @@
<span v-if="toMe">
<span class="people">{{ refund.from.alias }}</span>
vous doit
<span class="numeric">{{ refund.amount | money(account.mainCurrency) }}</span>
<span class="numeric">{{
refund.amount | money(account.mainCurrency)
}}</span>
</span>
<span v-else-if="fromMe">
Vous devez
<span class="numeric">{{ refund.amount | money(account.mainCurrency) }}</span>
<span class="numeric">{{
refund.amount | money(account.mainCurrency)
}}</span>
à
<span class="people">{{ refund.to.alias }}</span>
</span>
<span v-else>
<span class="people">{{ refund.from.alias }}</span>
doit
<span class="numeric">{{ refund.amount | money(account.mainCurrency) }}</span>
<span class="numeric">{{
refund.amount | money(account.mainCurrency)
}}</span>
à
<span class="people">{{ refund.to.alias }}</span>
</span>
</div>
</div>
<footer class="card-footer" v-if="canRefund && !refunded">
<confirm-button class="is-text is-fullwidth" @confirm="refundTo">Rembourser</confirm-button>
<confirm-button class="is-text is-fullwidth" @confirm="refundTo"
>Rembourser</confirm-button
>
</footer>
</div>
</template>
@@ -122,14 +130,14 @@ export default class RefundTransaction extends Vue {
if (!this.user || !this.refund.from) {
return false
}
return this.refund.from.email === this.user.email
return this.refund.from.userId === this.user.userId
}
public get toMe(): boolean {
if (!this.user || !this.refund.to) {
return false
}
return this.refund.to.email === this.user.email
return this.refund.to.userId === this.user.userId
}
}
</script>