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