fix clear filter wallet history
This commit is contained in:
@ -94,9 +94,9 @@ 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)
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -104,16 +104,17 @@ const ListToolbar = () => {
|
|||||||
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();
|
||||||
const threeMonthsAgo = getOneMonthsAgo();
|
const threeMonthsAgo = getOneMonthsAgo();
|
||||||
|
|||||||
Reference in New Issue
Block a user