feat: update dialog state

This commit is contained in:
Methapon2001 2024-08-08 10:33:45 +07:00
parent ba90a6534e
commit 314ffa8582

View file

@ -85,6 +85,9 @@ export const useCustomerForm = defineStore('form-customer', () => {
if (state.value.dialogType === 'create') {
state.value.editCustomerId = '';
}
if (state.value.dialogType === 'edit') {
state.value.dialogType = 'info';
}
currentFormData.value = structuredClone(resetFormData);
}
@ -99,6 +102,7 @@ export const useCustomerForm = defineStore('form-customer', () => {
if (!data) return;
state.value.dialogType = 'edit';
state.value.editCustomerId = id;
state.value.editCustomerCode = data.code;
state.value.customerImageUrl = `${apiBaseUrl}/customer/${id}/image`;