Fixed: Throw exception when getting courses
This commit is contained in:
parent
21158cd5e2
commit
2d66d23f6c
|
@ -210,6 +210,10 @@ class Api {
|
||||||
$url = self::$url."/ica/rest/nami/mitglied-ausbildung/filtered-for-navigation/mitglied/mitglied/{$memberId}/flist";
|
$url = self::$url."/ica/rest/nami/mitglied-ausbildung/filtered-for-navigation/mitglied/mitglied/{$memberId}/flist";
|
||||||
$response = $this->http()->get($url);
|
$response = $this->http()->get($url);
|
||||||
|
|
||||||
|
if (!$response->ok() || $response->json()['success'] === false) {
|
||||||
|
throw new RightException('Getting courses for member '.$memberId.' failed');
|
||||||
|
}
|
||||||
|
|
||||||
return collect($response->json()['data'])->map(function($course) use ($memberId) {
|
return collect($response->json()['data'])->map(function($course) use ($memberId) {
|
||||||
$single = $this->http()->get(self::$url."/ica/rest/nami/mitglied-ausbildung/filtered-for-navigation/mitglied/mitglied/{$memberId}/{$course['id']}")['data'];
|
$single = $this->http()->get(self::$url."/ica/rest/nami/mitglied-ausbildung/filtered-for-navigation/mitglied/mitglied/{$memberId}/{$course['id']}")['data'];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue