From cc95b3efa7d534b6ec10aabe3926c40d38293628 Mon Sep 17 00:00:00 2001 From: Wikzyy Date: Fri, 28 Mar 2025 20:59:12 +0700 Subject: [PATCH] fix edit form on fetch data --- src/pages/master/wallet/blocks/EditDialog.tsx | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/pages/master/wallet/blocks/EditDialog.tsx b/src/pages/master/wallet/blocks/EditDialog.tsx index b2b8695..c5faae1 100644 --- a/src/pages/master/wallet/blocks/EditDialog.tsx +++ b/src/pages/master/wallet/blocks/EditDialog.tsx @@ -111,7 +111,7 @@ const EditDialog = () => { name: response?.data.name, description: response?.data.description, status: response?.data.status, - currency_id: response?.data.currency_id, + currency_id: response?.data.id_currency, group: Array.isArray(response?.data.group) ? response?.data.group.map((target: GroupProps) => target.id) : [] @@ -156,6 +156,8 @@ const EditDialog = () => { .map((g) => g.name) .join(', '); + const selectedCurrency = currencies.find((currency) => currency.ID === formField.currency_id); + useEffect(() => { getCurrencyLists([{ id: 'name', desc: false }]); getGroupLists([{ id: 'name', desc: false }]); @@ -247,28 +249,14 @@ const EditDialog = () => {
- +
- +