Add new models and page for motions
This commit is contained in:
@@ -2,30 +2,35 @@
|
||||
|
||||
namespace App\Livewire\Person;
|
||||
|
||||
use Livewire\Component;
|
||||
use App\Services\RiksdagenService;
|
||||
use App\Enums\Parties;
|
||||
use App\Services\RiksdagenService;
|
||||
use Livewire\Component;
|
||||
|
||||
class Search extends Component
|
||||
{
|
||||
public $firstName = '';
|
||||
|
||||
public $lastName = '';
|
||||
|
||||
public $party = '';
|
||||
|
||||
public $results = [];
|
||||
|
||||
public $parties = [];
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parties = collect(Parties::cases())->sortBy(fn($party) => $party->label())->toArray();
|
||||
$this->parties = collect(Parties::cases())->sortBy(fn ($party) => $party->label())->toArray();
|
||||
}
|
||||
|
||||
public function search()
|
||||
{
|
||||
$service = app(RiksdagenService::class);
|
||||
|
||||
$this->results = $service->searchPerson(
|
||||
firstName: $this->firstName,
|
||||
lastName: $this->lastName,
|
||||
party: $this->party
|
||||
party: $this->party,
|
||||
)->original;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user