feat: add sort option to station search form
This commit is contained in:
@@ -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.';
|
||||
|
||||
Reference in New Issue
Block a user