🐛 (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

@@ -59,4 +59,4 @@
"typescript": "^3.5.3", "typescript": "^3.5.3",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"
} }
} }

View File

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