fix edit Wallet to sync variable formfield with response
This commit is contained in:
@ -76,7 +76,7 @@ const EditDialog = () => {
|
|||||||
// e.preventDefault();
|
// e.preventDefault();
|
||||||
|
|
||||||
const response = await PutData(
|
const response = await PutData(
|
||||||
`${API_URL_MASTER_DATA}/wallet/update/${selectedWallet?.Wallet_id}`,
|
`${API_URL_MASTER_DATA}/wallet/update/${selectedWallet?.id}`,
|
||||||
payload
|
payload
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ const EditDialog = () => {
|
|||||||
|
|
||||||
const createActivity = {
|
const createActivity = {
|
||||||
module: 'Manage Wallet',
|
module: 'Manage Wallet',
|
||||||
description: `Edit Wallet => ${selectedWallet?.Wallet_id} - ${selectedWallet?.Wallet_name}`,
|
description: `Edit Wallet => ${selectedWallet?.id} - ${selectedWallet?.name}`,
|
||||||
action: 'U'
|
action: 'U'
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ const EditDialog = () => {
|
|||||||
// currency_id: selectedWallet?.Wallet_currency_id,
|
// currency_id: selectedWallet?.Wallet_currency_id,
|
||||||
// group: selectedWallet?.Wallet_group
|
// group: selectedWallet?.Wallet_group
|
||||||
// }));
|
// }));
|
||||||
doFetchData(selectedWallet?.Wallet_id);
|
doFetchData(selectedWallet?.id);
|
||||||
}
|
}
|
||||||
}, [selectedWallet]);
|
}, [selectedWallet]);
|
||||||
|
|
||||||
|
|||||||
@ -7,12 +7,12 @@ import { Toaster } from 'sonner';
|
|||||||
import ListToolbar from '../blocks/ListToolbar';
|
import ListToolbar from '../blocks/ListToolbar';
|
||||||
|
|
||||||
interface WalletProps {
|
interface WalletProps {
|
||||||
Wallet_id: string;
|
id: string;
|
||||||
Wallet_name: string;
|
name: string;
|
||||||
Wallet_status: string;
|
status: string;
|
||||||
Wallet_description: string;
|
description: string;
|
||||||
Wallet_group: string[];
|
group: string[];
|
||||||
Wallet_currency_id: string;
|
currency_id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ContextProps {
|
interface ContextProps {
|
||||||
@ -155,7 +155,7 @@ const ManageWalletContextProvider = ({ children }: { children: React.ReactNode }
|
|||||||
order_direction: sorting[0].desc == false ? 'ASC' : 'DESC',
|
order_direction: sorting[0].desc == false ? 'ASC' : 'DESC',
|
||||||
filter: JSON.stringify(filter)
|
filter: JSON.stringify(filter)
|
||||||
});
|
});
|
||||||
console.log(response?.data);
|
// console.log(response?.data);
|
||||||
setWallets(response?.data.list);
|
setWallets(response?.data.list);
|
||||||
return { data: response?.data.list, totalCount: response?.data.total_count };
|
return { data: response?.data.list, totalCount: response?.data.total_count };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user