diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index d767eb9e..81927594 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -671,6 +671,7 @@ async function assignFormData(data: Customer & { branch: CustomerBranch[] }) { data.branch.forEach((v) => { formData.value.customerBranch?.push({ + id: v.id, address: v.address, addressEN: v.addressEN, provinceId: v.province.id, diff --git a/src/stores/customer/types.ts b/src/stores/customer/types.ts index 2465016b..b605d20b 100644 --- a/src/stores/customer/types.ts +++ b/src/stores/customer/types.ts @@ -87,7 +87,7 @@ export type CustomerBranchCreate = { }; export type CustomerCreate = { - customerBranch?: CustomerBranchCreate[]; + customerBranch?: (CustomerBranchCreate & { id?: string })[]; taxNo?: string | null; customerNameEN: string; customerName: string; @@ -101,7 +101,7 @@ export type CustomerUpdate = { customerType?: CustomerType; customerName?: string; customerNameEN?: string; - customerBranch?: CustomerBranchCreate[]; + customerBranch?: (CustomerBranchCreate & { id?: string })[]; taxNo?: string | null; image?: File; };