Fix api exception error
This commit is contained in:
parent
a2427fa19d
commit
1ebb229fbc
13
src/Api.php
13
src/Api.php
|
@ -121,17 +121,16 @@ class Api
|
||||||
if (data_get($attributes, 'id')) {
|
if (data_get($attributes, 'id')) {
|
||||||
$payload = array_merge($existing, $member->toNami());
|
$payload = array_merge($existing, $member->toNami());
|
||||||
$payload['kontoverbindung'] = json_encode(data_get($payload, 'kontoverbindung', []));
|
$payload['kontoverbindung'] = json_encode(data_get($payload, 'kontoverbindung', []));
|
||||||
$response = $this->http()->put(
|
$url = $this->url.'/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/'.$member->group_id.'/'.$member->id;
|
||||||
$this->url.'/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/'.$member->group_id.'/'.$member->id,
|
$response = $this->http()->put($url, $payload);
|
||||||
$payload
|
|
||||||
);
|
|
||||||
if (true !== data_get($response->json(), 'success')) {
|
if (true !== data_get($response->json(), 'success')) {
|
||||||
$this->exception('Update failed', $member->toNami(), $response->json());
|
$this->exception('Update failed', $url, $response->json(), $member->toNami());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$response = $this->http()->post($this->url.'/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/'.$member->group_id, $member->toNami());
|
$url = $this->url.'/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/'.$member->group_id;
|
||||||
|
$response = $this->http()->post($url, $member->toNami());
|
||||||
if (true !== data_get($response->json(), 'success')) {
|
if (true !== data_get($response->json(), 'success')) {
|
||||||
$this->exception('Update failed', $member->toNami(), $response->json());
|
$this->exception('Update failed', $url, $response->json(), $member->toNami());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['id' => $response->json()['data']];
|
return ['id' => $response->json()['data']];
|
||||||
|
|
Loading…
Reference in New Issue