update for filter transaction

This commit is contained in:
wayanrivan
2025-04-21 15:44:11 +07:00
parent 2db0287cc2
commit 6a81242a68
2 changed files with 12 additions and 9 deletions

View File

@ -164,9 +164,11 @@ const ListToolbar = () => {
variant="outline"
className="h-7.5"
onClick={() => {
// Preserve trxDate values (from, to) and reset others
const today = new Date();
const firstDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 1);
// Only reset filters excluding from and to
setSearchValue('');
setStatusValue('');
setTypeValue('');
@ -175,6 +177,7 @@ const ListToolbar = () => {
to: formatDate(today),
});
// Reset other filters except for date range
table.setColumnFilters([
{ id: 'code', value: '' },
{ id: 'status', value: '' },