some changes in Transaction view

This commit is contained in:
Bob Molitor committed 2025-10-20 21:14:55 +02:00
1 parent 2f7432c64d
commit 2baeba2904
1 file changed
+9 -2
@@ -16,6 +16,7 @@ new #[Layout('components.layouts.app')] class extends Component {
public string $search = ''; public string $search = '';
public string $status = 'all'; public string $status = 'all';
public ?int $selectedTransactionId = null; public ?int $selectedTransactionId = null;
protected int $perPage = 12;
protected $queryString = [ protected $queryString = [
'search' => ['except' => ''], 'search' => ['except' => ''],
@@ -70,7 +71,13 @@ new #[Layout('components.layouts.app')] class extends Component {
protected function refreshSelection(): void protected function refreshSelection(): void
{ {
$first = $this->transactions->first(); $first = $this->filteredQuery()
->orderByDesc('requires_review')
->orderByDesc('risk_score')
->orderByDesc('executed_at')
->forPage($this->getPage(), $this->perPage)
->first();
$this->selectedTransactionId = $first?->id; $this->selectedTransactionId = $first?->id;
} }
@@ -93,7 +100,7 @@ new #[Layout('components.layouts.app')] class extends Component {
->orderByDesc('requires_review') ->orderByDesc('requires_review')
->orderByDesc('risk_score') ->orderByDesc('risk_score')
->orderByDesc('executed_at') ->orderByDesc('executed_at')
->paginate(12); ->paginate($this->perPage);
} }
#[Computed] #[Computed]