fix clear filter wallet history
This commit is contained in:
@ -94,25 +94,26 @@ const ListToolbar = () => {
|
||||
|
||||
const handleClearAllFilters = () => {
|
||||
const today = new Date();
|
||||
const threeMonthsAgo = getOneMonthsAgo();
|
||||
const oneMonthAgo = getOneMonthsAgo();
|
||||
const resetDateRange = {
|
||||
from: formatDate(threeMonthsAgo),
|
||||
from: formatDate(oneMonthAgo),
|
||||
to: formatDate(today)
|
||||
};
|
||||
|
||||
|
||||
setSearchValue('');
|
||||
setWalletId('');
|
||||
setDateRange(resetDateRange);
|
||||
|
||||
// table.getAllColumns().forEach((column) => {
|
||||
// if (column.id !== 'CreatedAt') {
|
||||
// column.setFilterValue(undefined);
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
table.getColumn('msisdn')?.setFilterValue('');
|
||||
table.getColumn('id_wallet')?.setFilterValue('');
|
||||
table.getColumn('CreatedAt')?.setFilterValue(resetDateRange);
|
||||
table.setPageIndex(0);
|
||||
|
||||
setTimeout(() => {
|
||||
table.setPageIndex(0);
|
||||
reload();
|
||||
}, 0);
|
||||
};
|
||||
|
||||
|
||||
const handleRefresh = () => {
|
||||
const today = new Date();
|
||||
|
||||
Reference in New Issue
Block a user