refactor: remove resetFilters method and inline filter reset logic directly into the dashboard button action.

This commit is contained in:
Yoga Pangestu 2026-01-29 13:28:42 +07:00
parent 2e80c19c19
commit c507d0f8ef

View File

@ -44,14 +44,11 @@ protected function getHeaderActions(): array
->label('Reset Filter') ->label('Reset Filter')
->icon(Heroicon::XMark) ->icon(Heroicon::XMark)
->color('danger') ->color('danger')
->action(fn () => $this->resetFilters()) ->action(function () {
$this->filters['startDate'] = null;
$this->filters['endDate'] = null;
})
->visible(fn () => ! empty($this->filters['startDate']) || ! empty($this->filters['endDate'])), ->visible(fn () => ! empty($this->filters['startDate']) || ! empty($this->filters['endDate'])),
]; ];
} }
public function resetFilters(): void
{
$this->filters['startDate'] = null;
$this->filters['endDate'] = null;
}
} }