fix(service): make api endpoints configurable

This commit is contained in:
2024-08-04 15:15:12 +02:00
parent d6e56eed78
commit 1266195e24
9 changed files with 38 additions and 11 deletions

View File

@@ -18,6 +18,7 @@ class BriloApiComments
protected readonly HttpClientInterface $httpClient,
protected readonly LoggerInterface $logger,
protected readonly SerializerInterface $serializer,
protected readonly string $url,
protected readonly int $retryCount = 3,
protected readonly int $sleepTimeS = 1,
) {
@@ -30,6 +31,6 @@ class BriloApiComments
*/
public function getComments(): array
{
return $this->fetchApiResponse('https://jsonplaceholder.typicode.com/comments', Comment::class);
return $this->fetchApiResponse($this->url, Comment::class);
}
}