Skip to content

Commit

Permalink
Fix response when route not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mpysiak committed Oct 24, 2024
1 parent a1e812d commit f3e3593
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Sylius/Behat/Client/ApiPlatformClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ public function buildUpdateRequest(string $uri, ?string $id = null): self
$uri = sprintf('%s/%s', $uri, $id);
}

$response = $this->requestGet($uri);

$response = $this->requestGet($uri);
$content = $response->getContent();


$this->request = $this->requestFactory->update(
$this->section,
Expand All @@ -183,7 +186,7 @@ public function buildUpdateRequest(string $uri, ?string $id = null): self
$this->getToken(),
);

$this->request->setContent(json_decode($response->getContent(), true));
$this->request->setContent(json_decode($content, true) ?? []);

return $this;
}
Expand Down

0 comments on commit f3e3593

Please sign in to comment.