feat: auto reset form customer branch

This commit is contained in:
Methapon2001 2024-08-09 17:57:19 +07:00
parent 418ce20b06
commit d1afb438ea

View file

@ -334,6 +334,15 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => {
);
}
watch(
() => state.value.dialogType,
() => {
if (state.value.dialogType === 'create') {
currentFormData.value = structuredClone(defaultFormData);
}
},
);
async function submitForm() {
if (!state.value.currentCustomerId) {
throw new Error(