From fef07ae63253e8bdd4c42b5a6868c7dd4c205aea Mon Sep 17 00:00:00 2001 From: bagusajisaputroo Date: Fri, 2 May 2025 16:39:56 +0700 Subject: [PATCH] fix clear filter wallet history --- .../wallet-history/blocks/ListToolbar.tsx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/pages/wallet/wallet-history/blocks/ListToolbar.tsx b/src/pages/wallet/wallet-history/blocks/ListToolbar.tsx index 524bdf2..ff21a0a 100644 --- a/src/pages/wallet/wallet-history/blocks/ListToolbar.tsx +++ b/src/pages/wallet/wallet-history/blocks/ListToolbar.tsx @@ -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();