diff --git a/src/pages/03_customer-management/form.ts b/src/pages/03_customer-management/form.ts index 781e3cbf..3d64c4ad 100644 --- a/src/pages/03_customer-management/form.ts +++ b/src/pages/03_customer-management/form.ts @@ -59,7 +59,8 @@ export const useCustomerForm = defineStore('form-customer', () => { branchIndex: number; customerType: 'CORP' | 'PERS'; saveMode: 'customer' | 'branch'; - editId?: string; + editCustomerId?: string; + editCustomerBranchId?: string; }>({ dialogType: 'info', dialogOpen: false, @@ -67,7 +68,8 @@ export const useCustomerForm = defineStore('form-customer', () => { branchIndex: 0, customerType: 'CORP', saveMode: 'customer', - editId: '', + editCustomerId: '', + editCustomerBranchId: '', }); function isFormDataDifferent() { @@ -130,7 +132,8 @@ export const useCustomerForm = defineStore('form-customer', () => { } async function submitForm() { - if (state.value.dialogType === 'edit' && !state.value.editId) { + console.log(state.value.saveMode); + if (state.value.dialogType === 'edit' && !state.value.editCustomerId) { throw new Error('Form mode is set to edit but no ID is provided.'); } if (state.value.dialogType === 'edit') { @@ -140,7 +143,7 @@ export const useCustomerForm = defineStore('form-customer', () => { } async function submitCreate() { - customerStore.create(currentFormData.value); + // customerStore.create(currentFormData.value); } async function submitEdit() {} @@ -158,8 +161,3 @@ export const useCustomerForm = defineStore('form-customer', () => { export const useEmployeeForm = defineStore('form-employee', () => { return {}; }); - -export const useCustomerBranchForm = defineStore( - 'form-customer-branch', - () => {}, -);