refactor: return data

This commit is contained in:
Net 2024-08-13 16:43:34 +07:00
parent fd47115e3e
commit 99781c2b1e

View file

@ -359,15 +359,18 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => {
} }
if (!currentFormData.value.id) { if (!currentFormData.value.id) {
await customerStore.createBranch({ const res = await customerStore.createBranch({
...currentFormData.value, ...currentFormData.value,
customerId: state.value.currentCustomerId, customerId: state.value.currentCustomerId,
}); });
if(res) return res
} else { } else {
await customerStore.editBranchById(currentFormData.value.id, { const res = await customerStore.editBranchById(currentFormData.value.id, {
...currentFormData.value, ...currentFormData.value,
id: undefined, id: undefined,
}); });
if(res) return res
} }
} }