fix edit Wallet to sync variable formfield with response

This commit is contained in:
Wikzyy
2025-04-10 16:03:29 +07:00
parent 317d160c07
commit e39b475495
2 changed files with 10 additions and 10 deletions

View File

@ -76,7 +76,7 @@ const EditDialog = () => {
// e.preventDefault();
const response = await PutData(
`${API_URL_MASTER_DATA}/wallet/update/${selectedWallet?.Wallet_id}`,
`${API_URL_MASTER_DATA}/wallet/update/${selectedWallet?.id}`,
payload
);
@ -87,7 +87,7 @@ const EditDialog = () => {
const createActivity = {
module: 'Manage Wallet',
description: `Edit Wallet => ${selectedWallet?.Wallet_id} - ${selectedWallet?.Wallet_name}`,
description: `Edit Wallet => ${selectedWallet?.id} - ${selectedWallet?.name}`,
action: 'U'
};
@ -188,7 +188,7 @@ const EditDialog = () => {
// currency_id: selectedWallet?.Wallet_currency_id,
// group: selectedWallet?.Wallet_group
// }));
doFetchData(selectedWallet?.Wallet_id);
doFetchData(selectedWallet?.id);
}
}, [selectedWallet]);

View File

@ -7,12 +7,12 @@ import { Toaster } from 'sonner';
import ListToolbar from '../blocks/ListToolbar';
interface WalletProps {
Wallet_id: string;
Wallet_name: string;
Wallet_status: string;
Wallet_description: string;
Wallet_group: string[];
Wallet_currency_id: string;
id: string;
name: string;
status: string;
description: string;
group: string[];
currency_id: string;
}
interface ContextProps {
@ -155,7 +155,7 @@ const ManageWalletContextProvider = ({ children }: { children: React.ReactNode }
order_direction: sorting[0].desc == false ? 'ASC' : 'DESC',
filter: JSON.stringify(filter)
});
console.log(response?.data);
// console.log(response?.data);
setWallets(response?.data.list);
return { data: response?.data.list, totalCount: response?.data.total_count };
} catch (error) {