token n legacy

This commit is contained in:
unknown
2025-06-02 17:48:42 +07:00
parent 9658163803
commit 7a89e2a173

View File

@ -108,6 +108,7 @@ const AgentBalance = () => {
const handleReload = async () => {
setIsReloading(true);
await fetchAgentBalance(currentPage, pageSize, '','');
closeDialog()
setIsReloading(false);
// fetchAgentBalance();
};
@ -192,6 +193,7 @@ const AgentBalance = () => {
setToken_legacy={setToken_legacy}
customerId={formData.id}
agent_name={formData.agent_name}
handleReload={handleReload}
/>
</div>
</DialogContent>
@ -202,7 +204,7 @@ const AgentBalance = () => {
};
// ====================
const PaymentCard = ({ barcode, agent_name, customerId, token_legacy, setToken_legacy }: any) => {
const PaymentCard = ({ barcode, agent_name, customerId, token_legacy, setToken_legacy, handleReload }: any) => {
const cardRef: any = useRef(null);
const waitForImageLoad = (img: HTMLImageElement): Promise<void> => {
@ -248,6 +250,7 @@ const PaymentCard = ({ barcode, agent_name, customerId, token_legacy, setToken_l
token_legacy
});
toast.success(`Success Update Token Legacy`);
await handleReload();
} catch (error: any) {
let err_msg = error?.response?.data?.error || error.message
toast.error(err_msg);