From 42a036c34f0a76e2985e4cdfb7e201b23a0d8d62 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Thu, 22 Aug 2024 10:42:14 +0700 Subject: [PATCH] fix: missing zero fill --- 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 77f4b92..a510808 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: `${runningKey.replace("CUSTOMER_BRANCH_", "")}-${last.value - 1}`, + code: `${runningKey.replace("CUSTOMER_BRANCH_", "")}-${`${last.value - 1}`.padStart(2, "0")}`, customer: { connect: { id: customerId } }, province: { connect: provinceId ? { id: provinceId } : undefined }, district: { connect: districtId ? { id: districtId } : undefined },