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