From 92aaee2584a98dd84fec16b5a1c2cbd348512f7a Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Thu, 22 Aug 2024 10:14:40 +0700 Subject: [PATCH] fix: customer code come from wrong data --- src/controllers/customer-branch-controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/customer-branch-controller.ts b/src/controllers/customer-branch-controller.ts index 894ed18..77f4b92 100644 --- a/src/controllers/customer-branch-controller.ts +++ b/src/controllers/customer-branch-controller.ts @@ -349,7 +349,7 @@ export class CustomerBranchController extends Controller { }, data: { ...rest, - code: `${"citizenId" in body ? body.citizenId : body.legalPersonNo}-${last.value - 1}`, + code: `${runningKey.replace("CUSTOMER_BRANCH_", "")}-${last.value - 1}`, customer: { connect: { id: customerId } }, province: { connect: provinceId ? { id: provinceId } : undefined }, district: { connect: districtId ? { id: districtId } : undefined },