From 2c790de6066bd0bd15a1d7d81ce956313ec8f78f Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Wed, 17 Sep 2025 09:51:35 +0700 Subject: [PATCH] fix: customer status not change after used --- src/controllers/05-quotation-controller.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 942e4d1..f85b125 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -900,6 +900,20 @@ export class QuotationController extends Controller { }), ]); + if (customerBranch) { + await tx.customerBranch.update({ + where: { id: customerBranch.id }, + data: { + customer: { + update: { + status: Status.ACTIVE, + }, + }, + status: Status.ACTIVE, + }, + }); + } + return await tx.quotation.update({ include: { productServiceList: {