fix: แก้ไข เเล้วเปลี่ยนสถานะเป็น ACTIVE

This commit is contained in:
Net 2024-07-01 10:49:43 +07:00
parent 88b84396da
commit dcbc1b7080
2 changed files with 4 additions and 2 deletions

View file

@ -743,7 +743,7 @@ async function onSubmitEdit(id: string) {
if (!formData.value) return; if (!formData.value) return;
const tempValue: CustomerUpdate = { const tempValue: CustomerUpdate = {
status: 'ACTIVE', status: formData.value.status,
customerType: formData.value.customerType, customerType: formData.value.customerType,
customerName: formData.value.customerName, customerName: formData.value.customerName,
customerNameEN: formData.value.customerNameEN, customerNameEN: formData.value.customerNameEN,
@ -752,6 +752,8 @@ async function onSubmitEdit(id: string) {
personName: formData.value.personName, personName: formData.value.personName,
}; };
if(tempValue.status === 'CREATED') delete tempValue['status']
await editById(id, tempValue); await editById(id, tempValue);
infoDrawer.value = false; infoDrawer.value = false;
fetchListCustomer(); fetchListCustomer();

View file

@ -103,7 +103,7 @@ export type CustomerCreate = {
}; };
export type CustomerUpdate = { export type CustomerUpdate = {
status?: 'ACTIVE' | 'INACTIVE'; status?: Status;
customerType?: CustomerType; customerType?: CustomerType;
customerName?: string; customerName?: string;
customerNameEN?: string; customerNameEN?: string;