diff --git a/src/modules/04_registryNew/components/DialogAddData.vue b/src/modules/04_registryNew/components/DialogAddData.vue index 909e18506..44b9f34ab 100644 --- a/src/modules/04_registryNew/components/DialogAddData.vue +++ b/src/modules/04_registryNew/components/DialogAddData.vue @@ -21,11 +21,9 @@ const profileStore = useProfileDataStore(); const $q = useQuasar(); const store = useRegistryNewDataStore(); const { - dialogRemove, dialogConfirm, success, messageError, - showLoader, hideLoader, dialogMessageNotify, date2Thai, @@ -54,24 +52,6 @@ const formData = reactive({ birthDate: null, }); -const prefixRef = ref(null); -const firstNameRef = ref(null); -const lastNameRef = ref(null); -const citizenIdRef = ref(null); -const positionRef = ref(null); -const posTypeIdRef = ref(null); -const posLevelIdRef = ref(null); - -const objectRef: MyObjectRef = { - prefix: prefixRef, - firstName: firstNameRef, - lastName: lastNameRef, - citizenId: citizenIdRef, - position: positionRef, - posTypeId: posTypeIdRef, - posLevelId: posLevelIdRef, -}; - function fetchPrefix() { http .get(config.API.orgPrefix) @@ -152,22 +132,6 @@ function clearFormData() { formData.birthDate = null; } -function validateForm() { - const hasError = []; - for (const key in objectRef) { - if (Object.prototype.hasOwnProperty.call(objectRef, key)) { - const property = objectRef[key]; - if (property.value && typeof property.value.validate === "function") { - const isValid = property.value.validate(); - hasError.push(isValid); - } - } - } - if (hasError.every((result) => result === true)) { - onSubmit(); - } -} - async function onSubmit() { dialogConfirm($q, async () => { await http @@ -209,35 +173,38 @@ watch(