refactor: remove resetFilters method and inline filter reset logic directly into the dashboard button action.
This commit is contained in:
parent
2e80c19c19
commit
c507d0f8ef
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user