From ed5dc2d872d1685f6c815c70ca1c0c249ea4ad42 Mon Sep 17 00:00:00 2001 From: Net Date: Wed, 24 Jul 2024 11:47:03 +0700 Subject: [PATCH] fix: Solve product creation --- .../04_product-service/BasicInformation.vue | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/04_product-service/BasicInformation.vue b/src/components/04_product-service/BasicInformation.vue index b51ce684..8ce9f070 100644 --- a/src/components/04_product-service/BasicInformation.vue +++ b/src/components/04_product-service/BasicInformation.vue @@ -41,6 +41,7 @@ const props = defineProps<{ $t(isType ? 'productAndServiceTypeName' : 'productAndServiceGroupName') " v-model="name" + :rules="[(val: string) => !!val || $t('pleaseInformation')]" /> { + const roles = getRole() || []; + const isSpecialRole = ['admin', 'system', 'head_of_admin'].some( + (role) => roles.includes(role), + ); + return isSpecialRole || !!val || 'กรุณากรอกข้อมูล'; + }, + ]" + clearable />