เพิ่มตัวแปรลง store เพิ่มเงื่อนไข

This commit is contained in:
AnandaTon 2023-10-06 15:21:23 +07:00
parent a4747e1f89
commit 07dad32620
2 changed files with 7 additions and 8 deletions

View file

@ -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, 'บันทึกข้อมูลส่วนตัวสำเร็จ')

View file

@ -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)