From 5ccd8909d5a0aa23020700b37459c37fcfa71133 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Mon, 30 Sep 2024 09:17:49 +0700 Subject: [PATCH] refactor: include full detail when get by id --- src/controllers/05-quotation-controller.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 8d0e51a..fb5d20c 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -220,7 +220,12 @@ export class QuotationController extends Controller { async getQuotationById(@Path() quotationId: string) { const record = await prisma.quotation.findUnique({ include: { - worker: true, + _count: { + select: { worker: true }, + }, + worker: { + include: { employee: true }, + }, service: { include: { _count: { select: { work: true } },