From 1940f914ee08d8b5320ee9b50380cf1d792a08bd Mon Sep 17 00:00:00 2001 From: Net Date: Mon, 9 Sep 2024 16:27:56 +0700 Subject: [PATCH] refactor: edit conditions rules --- .../01_branch-management/FormBranchInformation.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/01_branch-management/FormBranchInformation.vue b/src/components/01_branch-management/FormBranchInformation.vue index 9c8e0607..508d8c83 100644 --- a/src/components/01_branch-management/FormBranchInformation.vue +++ b/src/components/01_branch-management/FormBranchInformation.vue @@ -155,8 +155,10 @@ function formatCode(input: string | undefined, type: 'code' | 'number') { ? $t('branch.form.headofficeNameEN') : $t('branch.form.branchNameEN') " - :rules="[(val) => val && /^[A-Za-z]+$/.test(val)]" - :error-message="$t('form.error.required')" + :rules="[ + (val) => !!val || $t('form.error.required'), + (val) => /^[A-Za-z]+$/.test(val) || $t('form.error.letterOnly'), + ]" for="input-name-en" />