fix(customers): online customer form tweaks
This commit is contained in:
@@ -391,7 +391,21 @@ async function submitEdit() {
|
|||||||
await editFormRef.value?.validate()
|
await editFormRef.value?.validate()
|
||||||
if (!editId.value) return
|
if (!editId.value) return
|
||||||
actionLoading.value = true
|
actionLoading.value = true
|
||||||
await updateCustomer(editId.value, editForm.value as Customer)
|
const payload: Partial<Customer> = {
|
||||||
|
fname: editForm.value.fname,
|
||||||
|
lname: editForm.value.lname,
|
||||||
|
mobile: editForm.value.mobile,
|
||||||
|
birth_date: editForm.value.birth_date,
|
||||||
|
phone_number: editForm.value.phone_number,
|
||||||
|
province: editForm.value.province,
|
||||||
|
city: editForm.value.city,
|
||||||
|
n_code: editForm.value.n_code,
|
||||||
|
}
|
||||||
|
const password = String(editForm.value.password || '').trim()
|
||||||
|
if (password !== '') {
|
||||||
|
payload.password = password
|
||||||
|
}
|
||||||
|
await updateCustomer(editId.value, payload as Customer)
|
||||||
message.success('ویرایش با موفقیت انجام شد')
|
message.success('ویرایش با موفقیت انجام شد')
|
||||||
editVisible.value = false
|
editVisible.value = false
|
||||||
await load()
|
await load()
|
||||||
|
|||||||
Reference in New Issue
Block a user