fix: แก้ไขรูปนายจ้างไม่ได้

This commit is contained in:
Net 2024-07-08 18:01:04 +07:00
parent 33ca54adca
commit fe96dba906

View file

@ -666,6 +666,9 @@ function onCloseBranch() {
} }
function clearForm() { function clearForm() {
profileFile.value = undefined;
dialogInputForm.value = false; dialogInputForm.value = false;
formData.value = { formData.value = {
status: 'CREATED', status: 'CREATED',
@ -958,7 +961,9 @@ async function toggleStatusCustomer(id: string, status: boolean) {
} }
async function onSubmitEdit(id: string) { async function onSubmitEdit(id: string) {
if (selectorLabel.value === 'EMPLOYER') { if (selectorLabel.value === 'EMPLOYER') {
if (!formData.value) return; if (!formData.value) return;
const tempValue: CustomerUpdate = { const tempValue: CustomerUpdate = {
@ -970,10 +975,15 @@ async function onSubmitEdit(id: string) {
customerBranch: formData.value.customerBranch, customerBranch: formData.value.customerBranch,
taxNo: formData.value.taxNo, taxNo: formData.value.taxNo,
personName: formData.value.personName, personName: formData.value.personName,
image: profileFile.value ,
}; };
if (tempValue.status === 'CREATED') delete tempValue['status']; if (tempValue.status === 'CREATED') delete tempValue['status'];
await editById(id, tempValue); await editById(id, tempValue);
infoDrawer.value = false; infoDrawer.value = false;
fetchListCustomer(); fetchListCustomer();