feat: add sort option to station search form

This commit is contained in:
Ovidiu U
2026-04-05 20:48:00 +01:00
parent cd9d833e44
commit fa94bb537b
3 changed files with 14 additions and 1 deletions

View File

@@ -19,6 +19,9 @@ class StationSearch extends Component
#[Validate('required|integer|min:1|max:20')]
public int $radius = 5;
#[Validate('required|string|in:price,distance,updated,brand')]
public string $sort = 'price';
public array $results = [];
public array $meta = [];
@@ -42,7 +45,7 @@ class StationSearch extends Component
'postcode' => $this->search,
'fuel_type' => $this->fuelType,
'radius' => $radiusKm,
'sort' => 'price',
'sort' => $this->sort,
]);
} catch (ConnectionException) {
$this->apiError = 'Unable to fetch stations. Please try again.';