From 6dcd01ffe47a31f792a662094a152d07521b2a96 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Tue, 29 Oct 2024 14:21:26 +0700 Subject: [PATCH] fix: product was delete on not send list product --- src/controllers/05-quotation-controller.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 3775dcf..3d9d364 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -763,10 +763,12 @@ export class QuotationController extends Controller { }, } : undefined, - productServiceList: { - deleteMany: {}, - create: list, - }, + productServiceList: list + ? { + deleteMany: {}, + create: list, + } + : undefined, updatedByUserId: req.user.sub, }, });