refactor: return data
This commit is contained in:
parent
fd47115e3e
commit
99781c2b1e
1 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue