Add new models and page for motions
This commit is contained in:
@@ -22,7 +22,7 @@ class RiksdagenService
|
||||
string $lastName = '',
|
||||
string $party = ''
|
||||
): JsonResponse {
|
||||
$response = $this->http->get('personlista/', [
|
||||
$response = $this->http->get('personlista/', [
|
||||
'query' => [
|
||||
'iid' => $mp_id,
|
||||
'parti' => $party,
|
||||
@@ -30,8 +30,8 @@ class RiksdagenService
|
||||
'enamn' => $lastName,
|
||||
'utformat' => 'json',
|
||||
'sort' => 'sorteringsnamn',
|
||||
'sortorder' => 'asc'
|
||||
]
|
||||
'sortorder' => 'asc',
|
||||
],
|
||||
])->getBody()->getContents();
|
||||
|
||||
$data = json_decode($response);
|
||||
@@ -44,14 +44,92 @@ class RiksdagenService
|
||||
string $party = '',
|
||||
string $date = '',
|
||||
): JsonResponse {
|
||||
$response = $this->http->get('voteringlista/', [
|
||||
$response = $this->http->get('voteringlista/', [
|
||||
'query' => [
|
||||
'iid' => $mp_id,
|
||||
'rm' => $date,
|
||||
'parti' => $party,
|
||||
'utformat' => 'json',
|
||||
'sz' => '500',
|
||||
]
|
||||
'sz' => '3000',
|
||||
],
|
||||
])->getBody()->getContents();
|
||||
|
||||
$data = json_decode($response);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function getPersonMotions(
|
||||
string $mp_id,
|
||||
string $date = '',
|
||||
): JsonResponse {
|
||||
$response = $this->http->get('dokumentlista/', [
|
||||
'query' => [
|
||||
'iid' => $mp_id,
|
||||
'rm' => $date,
|
||||
'doktyp' => 'mot',
|
||||
'utformat' => 'json',
|
||||
],
|
||||
])->getBody()->getContents();
|
||||
|
||||
$data = json_decode($response);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function getPartyMotions(
|
||||
string $party,
|
||||
string $date = '',
|
||||
|
||||
): JsonResponse {
|
||||
$response = $this->http->get('dokumentlista/', [
|
||||
'query' => [
|
||||
'parti' => $party,
|
||||
'rm' => $date,
|
||||
'doktyp' => 'mot',
|
||||
'utformat' => 'json',
|
||||
],
|
||||
])->getBody()->getContents();
|
||||
|
||||
$data = json_decode($response);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function searchMotions(
|
||||
string $query = '',
|
||||
string $party = '',
|
||||
string $dateInterval = '',
|
||||
int $page = 1
|
||||
): JsonResponse {
|
||||
$response = $this->http->get('dokumentlista/', [
|
||||
'query' => array_filter([
|
||||
'sok' => $query,
|
||||
'parti' => $party,
|
||||
'rm' => $dateInterval,
|
||||
'doktyp' => 'mot',
|
||||
'utformat' => 'json',
|
||||
'p' => $page,
|
||||
]),
|
||||
])->getBody()->getContents();
|
||||
|
||||
$data = json_decode($response);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function getMotion(
|
||||
string $bet,
|
||||
string $tempbet,
|
||||
string $nr,
|
||||
): JsonResponse {
|
||||
$response = $this->http->get('dokumentlista/', [
|
||||
'query' => [
|
||||
'bet' => $bet,
|
||||
'tempbet' => $tempbet,
|
||||
'nr' => $nr,
|
||||
'utformat' => 'json',
|
||||
],
|
||||
])->getBody()->getContents();
|
||||
|
||||
$data = json_decode($response);
|
||||
|
||||
Reference in New Issue
Block a user