fix: type error

This commit is contained in:
Methapon Metanipat 2024-09-26 09:59:26 +07:00
parent 61b7f19577
commit d740a48c7f
5 changed files with 57 additions and 57 deletions

View file

@ -2171,7 +2171,7 @@ const emptyCreateDialog = ref(false);
} else {
res = await customerStore.createBranch({
...customerFormData.customerBranch[idx],
customerId: customerFormState.editCustomerId,
customerId: customerFormState.editCustomerId || '',
id: undefined,
});
}
@ -2230,6 +2230,7 @@ const emptyCreateDialog = ref(false);
<EmployerFormBranch
:index="idx"
prefixId="form"
v-if="customerFormData.customerBranch"
v-model:customer="customerFormData"
v-model:customer-branch="customerFormData.customerBranch[idx]"
:onCreate="customerFormState.dialogType === 'create'"
@ -2245,6 +2246,8 @@ const emptyCreateDialog = ref(false);
@cancel="() => customerFormUndo(false)"
@delete="
async () => {
if (!customerFormState.editCustomerId) return;
if (idx === 0) {
deleteCustomerById(customerFormState.editCustomerId);
return;