From b5cdb24228dd5b76b1188aa11d25f7b9170782dd Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:42:47 +0700 Subject: [PATCH] fix: wrong condition --- src/controllers/04-invoice-controller.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/controllers/04-invoice-controller.ts b/src/controllers/04-invoice-controller.ts index 2dc80bb..94794c3 100644 --- a/src/controllers/04-invoice-controller.ts +++ b/src/controllers/04-invoice-controller.ts @@ -58,18 +58,21 @@ export class InvoiceController extends Controller { prisma.invoice.count({ where: { ...where, - payment: { paymentStatus: { not: PaymentStatus.PaymentSuccess } }, + payment: { paymentStatus: PaymentStatus.PaymentSuccess }, }, }), prisma.invoice.count({ where: { ...where, - payment: { paymentStatus: PaymentStatus.PaymentSuccess }, + payment: { paymentStatus: { not: PaymentStatus.PaymentSuccess } }, }, }), ]); - return { pay, notPay }; + return { + [PaymentStatus.PaymentSuccess]: pay, + [PaymentStatus.PaymentWait]: notPay, + }; } @Get()