Skip to content

Commit

Permalink
(refactor): improve validation on status explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike van den Hoek committed Dec 16, 2024
1 parent 8c3dcc1 commit 6afa67a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Endpoints/ZakenEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace OWC\Zaaksysteem\Endpoints;

use OWC\Zaaksysteem\Entities\Entity;
use OWC\Zaaksysteem\Entities\Status;
use OWC\Zaaksysteem\Entities\StatusType;
use OWC\Zaaksysteem\Entities\Zaak;
use OWC\Zaaksysteem\Http\Response;
use OWC\Zaaksysteem\Resolvers\ContainerResolver;
Expand Down Expand Up @@ -52,7 +52,7 @@ protected function buildEntity($data): Entity
$class = $this->entityClass;
$zaak = new $class($data, $this->client::CALLABLE_NAME, $this->client::CLIENT_NAME);

$statusToelichting = $zaak->status instanceof Status && isset($zaak->status->statustype) ? $zaak->status->statustype->statusExplanation() : '';
$statusToelichting = $zaak->status->statustype instanceof StatusType ? $zaak->status->statustype->statusExplanation() : '';
$zaak->setValue('leverancier', $zaak->getClientNamePretty());
$zaak->setValue('steps', $this->handleProcessStatusses($this->getStatussenSorted($zaak), $statusToelichting));
$zaak->setValue('status_history', $zaak->statussen);
Expand Down

0 comments on commit 6afa67a

Please sign in to comment.