fix clear filter wallet history

This commit is contained in:
bagusajisaputroo
2025-05-02 16:39:56 +07:00
parent 30b26216da
commit fef07ae632

View File

@ -94,25 +94,26 @@ const ListToolbar = () => {
const handleClearAllFilters = () => { const handleClearAllFilters = () => {
const today = new Date(); const today = new Date();
const threeMonthsAgo = getOneMonthsAgo(); const oneMonthAgo = getOneMonthsAgo();
const resetDateRange = { const resetDateRange = {
from: formatDate(threeMonthsAgo), from: formatDate(oneMonthAgo),
to: formatDate(today) to: formatDate(today)
}; };
setSearchValue(''); setSearchValue('');
setWalletId(''); setWalletId('');
setDateRange(resetDateRange); setDateRange(resetDateRange);
// table.getAllColumns().forEach((column) => { table.getColumn('msisdn')?.setFilterValue('');
// if (column.id !== 'CreatedAt') { table.getColumn('id_wallet')?.setFilterValue('');
// column.setFilterValue(undefined);
// }
// });
table.getColumn('CreatedAt')?.setFilterValue(resetDateRange); table.getColumn('CreatedAt')?.setFilterValue(resetDateRange);
table.setPageIndex(0);
setTimeout(() => {
table.setPageIndex(0);
reload();
}, 0);
}; };
const handleRefresh = () => { const handleRefresh = () => {
const today = new Date(); const today = new Date();