From 9a67e3a6e91282f65efa92b4303360ae575689ad Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Mon, 7 Oct 2024 16:13:49 +0700 Subject: [PATCH] feat: work 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 3e0ec78..8dd46ea 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -252,7 +252,10 @@ export class QuotationController extends Controller { product: body.productServiceList .map((v) => v.productId) .filter((v, i, a) => a.findIndex((c) => c === v) === i), - work: body.productServiceList.map((v) => v.workId || []).flat(), + work: body.productServiceList + .map((v) => v.workId || []) + .filter((v, i, a) => a.findIndex((c) => c === v) === i) + .flat(), service: body.productServiceList.map((v) => v.serviceId || []).flat(), };