fix: missing zero fill

This commit is contained in:
Methapon Metanipat 2024-08-22 10:42:14 +07:00
parent 92aaee2584
commit 42a036c34f

View file

@ -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 },