refactor: restructure

This commit is contained in:
Methapon2001 2024-08-08 09:06:00 +07:00
parent 7a81991c79
commit 11ff03ec50
8 changed files with 16 additions and 9 deletions

View file

@ -58,7 +58,6 @@ export const useCustomerForm = defineStore('form-customer', () => {
);
function isFormDataDifferent() {
console.log(resetFormData, currentFormData.value);
return (
JSON.stringify(resetFormData) !== JSON.stringify(currentFormData.value)
);
@ -66,6 +65,7 @@ export const useCustomerForm = defineStore('form-customer', () => {
function resetForm(clean = false) {
state.value.branchIndex = -1;
state.value.readonly = true;
if (clean) {
defaultFormData.customerType = currentFormData.value.customerType;
currentFormData.value = structuredClone(defaultFormData);