From 9612e71a88403082abebe4d8a4b3254ccb64970b Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Mon, 7 Oct 2024 16:17:31 +0700 Subject: [PATCH] fix: array length not match --- src/controllers/05-quotation-controller.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 8dd46ea..4ff523b 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -256,7 +256,10 @@ export class QuotationController extends Controller { .map((v) => v.workId || []) .filter((v, i, a) => a.findIndex((c) => c === v) === i) .flat(), - service: body.productServiceList.map((v) => v.serviceId || []).flat(), + service: body.productServiceList + .map((v) => v.serviceId || []) + .filter((v, i, a) => a.findIndex((c) => c === v) === i) + .flat(), }; const [customerBranch, employee, product, work, service] = await prisma.$transaction(