diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 3ba54350..2746124e 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -743,7 +743,7 @@ async function onSubmitEdit(id: string) { if (!formData.value) return; const tempValue: CustomerUpdate = { - status: 'ACTIVE', + status: formData.value.status, customerType: formData.value.customerType, customerName: formData.value.customerName, customerNameEN: formData.value.customerNameEN, @@ -752,6 +752,8 @@ async function onSubmitEdit(id: string) { personName: formData.value.personName, }; + if(tempValue.status === 'CREATED') delete tempValue['status'] + await editById(id, tempValue); infoDrawer.value = false; fetchListCustomer(); diff --git a/src/stores/customer/types.ts b/src/stores/customer/types.ts index ad2f3043..144219af 100644 --- a/src/stores/customer/types.ts +++ b/src/stores/customer/types.ts @@ -103,7 +103,7 @@ export type CustomerCreate = { }; export type CustomerUpdate = { - status?: 'ACTIVE' | 'INACTIVE'; + status?: Status; customerType?: CustomerType; customerName?: string; customerNameEN?: string;