diff --git a/src/modules/01_exam/components/ExamForm.vue b/src/modules/01_exam/components/ExamForm.vue index dfe1101..fe8e8ad 100644 --- a/src/modules/01_exam/components/ExamForm.vue +++ b/src/modules/01_exam/components/ExamForm.vue @@ -233,15 +233,14 @@ const saveForm = async () => { const clickSave = async () => { saveAuto.value = false - if (defaultInformation.value.profileImg == null || '') { - notifyError($q, 'กรุณาอัพโหลดรูปถ่าย') - } else { - await saveData() - } + await saveData() } const saveData = async () => { - //เช็ครูป + if (defaultInformation.value.profileImg == null || '') { + notifyError($q, 'กรุณาอัพโหลดรูปถ่าย') + return + } await formInformation.value.validate().then(async (suc: boolean) => { if (suc) { await formAddress.value.validate().then(async (suc: boolean) => { @@ -309,8 +308,7 @@ const saveData = async () => { contactfirstname: defaultContact.value.contactfirstname, contactlastname: defaultContact.value.contactlastname, contactrelations: defaultContact.value.contactrelations, - contacttel: defaultContact.value.contacttel, - profileImg: defaultInformation.value.profileImg + contacttel: defaultContact.value.contacttel }) .then(async () => { success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ') diff --git a/src/modules/01_exam/components/Form/Information.vue b/src/modules/01_exam/components/Form/Information.vue index a64dc55..7b38316 100644 --- a/src/modules/01_exam/components/Form/Information.vue +++ b/src/modules/01_exam/components/Form/Information.vue @@ -539,6 +539,7 @@ const fetchImgData = async () => { .then((res) => { const data = res.data.result img.value = data + defaultInformation.value.profileImg = data }) .catch((e) => { // messageError($q, e)