From 314ffa858235875d648418ab0258aed39c1a98f9 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:33:45 +0700 Subject: [PATCH] feat: update dialog state --- src/pages/03_customer-management/form.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/03_customer-management/form.ts b/src/pages/03_customer-management/form.ts index 988dbb40..7871a34a 100644 --- a/src/pages/03_customer-management/form.ts +++ b/src/pages/03_customer-management/form.ts @@ -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`;