From 04a64028baf9e95ce41d8bdf00af4b01b8803091 Mon Sep 17 00:00:00 2001 From: Bratu Sebastian Date: Wed, 20 Dec 2023 08:56:56 +0200 Subject: [PATCH] fix sms sending voucher bug ( relation not loaded by query, so id is null) (#114) --- src/modules/payer-svc/payer.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/payer-svc/payer.service.ts b/src/modules/payer-svc/payer.service.ts index f0b238f..b70fac3 100644 --- a/src/modules/payer-svc/payer.service.ts +++ b/src/modules/payer-svc/payer.service.ts @@ -167,7 +167,10 @@ export class PayerService { .leftJoinAndSelect('payer.user', 'user') .where('user.id = :userId', { userId: authUser.sub }) .getOne(), - this.voucherRepository.findOne({ where: { shortenHash } }), + this.voucherRepository.findOne({ + where: { shortenHash }, + relations: { transaction: true }, + }), ]); const transaction = await this.transactionRepository.findOne({ where: { id: voucher.transaction.id },