Skip to content

Commit

Permalink
Merge pull request #109 from 5pm-HDH/108-update-request
Browse files Browse the repository at this point in the history
feat(update): update person
  • Loading branch information
DumbergerL authored Sep 12, 2022
2 parents 907cb5b + 16b252f commit 32500f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- [Refactor delete person](https://github.com/5pm-HDH/churchtools-api/pull/100)
- [Refactor FillWithData](https://github.com/5pm-HDH/churchtools-api/pull/101)
- [Refactor: Use Query-Parameters for Where-Clause](https://github.com/5pm-HDH/churchtools-api/pull/106)
- [Fix Unit-Test for Person Update-Request](https://github.com/5pm-HDH/churchtools-api/pull/109)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion src/CTClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private function handleResponse(ResponseInterface $response): ResponseInterface
{
$responseCode = (int)$response->getStatusCode();
if ($responseCode == 401 || $responseCode == 403) {
throw new CTPermissionException("Unauthorized or Forbidden.", $responseCode);
throw CTPermissionException::ofErrorResponse($response);
}

if ($responseCode >= 200 && $responseCode <= 299) {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Requests/PersonUpdateRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testUpdatePersonWholeObject()

// Update Birthname
$me->setBirthName($newBirthName);
PersonRequest::update($me);
PersonRequest::update($me, ["birthName", "firstName", "lastName"]);

// Reload Person-Object
$meReloaded = PersonRequest::whoami();
Expand Down

0 comments on commit 32500f6

Please sign in to comment.