diff --git a/src/pages/03_customer-management/form.ts b/src/pages/03_customer-management/form.ts index 7f5c3e48..1306b887 100644 --- a/src/pages/03_customer-management/form.ts +++ b/src/pages/03_customer-management/form.ts @@ -359,15 +359,18 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => { } if (!currentFormData.value.id) { - await customerStore.createBranch({ + const res = await customerStore.createBranch({ ...currentFormData.value, customerId: state.value.currentCustomerId, }); + if(res) return res + } else { - await customerStore.editBranchById(currentFormData.value.id, { + const res = await customerStore.editBranchById(currentFormData.value.id, { ...currentFormData.value, id: undefined, }); + if(res) return res } }