fix(customers): online customer form tweaks

This commit is contained in:
2026-09-09 16:57:32 +03:30
parent 2d5e8da2cb
commit 3c56672a27
+15 -1
View File
@@ -391,7 +391,21 @@ async function submitEdit() {
await editFormRef.value?.validate()
if (!editId.value) return
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('ویرایش با موفقیت انجام شد')
editVisible.value = false
await load()