From fe365d31b80416224b1729e8627de34c164e715b Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Thu, 24 Oct 2024 11:11:08 +0700 Subject: [PATCH] fix: wrong sort --- src/controllers/05-quotation-payment-controller.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/05-quotation-payment-controller.ts b/src/controllers/05-quotation-payment-controller.ts index 262fb68..1aebfe2 100644 --- a/src/controllers/05-quotation-payment-controller.ts +++ b/src/controllers/05-quotation-payment-controller.ts @@ -27,9 +27,10 @@ export class QuotationPayment extends Controller { async getPayment(@Path() quotationId: string) { const record = await prisma.quotation.findFirst({ where: { id: quotationId }, - orderBy: { createdAt: "asc" }, include: { - quotationPaymentData: true, + quotationPaymentData: { + orderBy: { date: "asc" }, + }, createdBy: true, updatedBy: true, },