fix: wrong detect customer type
This commit is contained in:
parent
425bd0b784
commit
15277d3a03
1 changed files with 5 additions and 0 deletions
|
|
@ -312,6 +312,7 @@ export const useCustomerForm = defineStore('form-customer', () => {
|
||||||
|
|
||||||
export const useCustomerBranchForm = defineStore('form-customer-branch', () => {
|
export const useCustomerBranchForm = defineStore('form-customer-branch', () => {
|
||||||
const customerStore = useCustomerStore();
|
const customerStore = useCustomerStore();
|
||||||
|
const customerFormStore = useCustomerForm();
|
||||||
|
|
||||||
const defaultFormData: CustomerBranchCreate & { id?: string } = {
|
const defaultFormData: CustomerBranchCreate & { id?: string } = {
|
||||||
code: '',
|
code: '',
|
||||||
|
|
@ -442,6 +443,10 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => {
|
||||||
if (!currentFormData.value.id) {
|
if (!currentFormData.value.id) {
|
||||||
const res = await customerStore.createBranch({
|
const res = await customerStore.createBranch({
|
||||||
...currentFormData.value,
|
...currentFormData.value,
|
||||||
|
citizenId:
|
||||||
|
customerFormStore.currentFormData.customerType === 'CORP'
|
||||||
|
? undefined
|
||||||
|
: currentFormData.value.citizenId,
|
||||||
customerId: state.value.currentCustomerId,
|
customerId: state.value.currentCustomerId,
|
||||||
});
|
});
|
||||||
if (res) return res;
|
if (res) return res;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue