diff --git a/src/pages/03_customer-management/form.ts b/src/pages/03_customer-management/form.ts index 987a3219..0a8795ad 100644 --- a/src/pages/03_customer-management/form.ts +++ b/src/pages/03_customer-management/form.ts @@ -312,6 +312,7 @@ export const useCustomerForm = defineStore('form-customer', () => { export const useCustomerBranchForm = defineStore('form-customer-branch', () => { const customerStore = useCustomerStore(); + const customerFormStore = useCustomerForm(); const defaultFormData: CustomerBranchCreate & { id?: string } = { code: '', @@ -442,6 +443,10 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => { if (!currentFormData.value.id) { const res = await customerStore.createBranch({ ...currentFormData.value, + citizenId: + customerFormStore.currentFormData.customerType === 'CORP' + ? undefined + : currentFormData.value.citizenId, customerId: state.value.currentCustomerId, }); if (res) return res;