diff --git a/CHANGELOG.md b/CHANGELOG.md index f22f31fa6..a4602bd36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- [#240](https://github.com/os2display/display-api-service/pull/240) + - Fixed issues with Colibo feed type. - [#226](https://github.com/os2display/display-api-service/pull/226) - Added Colibo feed type. diff --git a/src/Feed/ColiboFeedType.php b/src/Feed/ColiboFeedType.php index 65526ab69..1fd76af60 100644 --- a/src/Feed/ColiboFeedType.php +++ b/src/Feed/ColiboFeedType.php @@ -8,6 +8,7 @@ use App\Entity\Tenant\FeedSource; use App\Feed\OutputModel\ConfigOption; use App\Feed\SourceType\Colibo\ApiClient; +use App\Feed\SourceType\Colibo\SecretsDTO; use App\Service\FeedService; use FeedIo\Feed\Item; use FeedIo\Feed\Node\Category; @@ -64,15 +65,21 @@ public function getAdminFormOptions(FeedSource $feedSource): array public function getData(Feed $feed): array { - $configuration = $feed->getConfiguration(); - $secrets = $feed->getFeedSource()?->getSecrets() ?? []; - $result = [ 'title' => 'Intranet', 'entries' => [], ]; - $baseUri = $secrets['api_base_uri']; + $configuration = $feed->getConfiguration(); + $feedSource = $feed->getFeedSource(); + + if (null == $feedSource) { + return $result; + } + + $secrets = new SecretsDTO($feedSource); + + $baseUri = $secrets->apiBaseUri; $recipients = $configuration['recipients'] ?? []; $publishers = $configuration['publishers'] ?? []; $pageSize = isset($configuration['page_size']) ? (int) $configuration['page_size'] : 10; diff --git a/src/Feed/SourceType/Colibo/ApiClient.php b/src/Feed/SourceType/Colibo/ApiClient.php index ae98dab19..9751efc4d 100644 --- a/src/Feed/SourceType/Colibo/ApiClient.php +++ b/src/Feed/SourceType/Colibo/ApiClient.php @@ -84,7 +84,7 @@ public function getFeedEntriesNews(FeedSource $feedSource, array $recipients = [ * * @return array */ - public function getSearchGroups(FeedSource $feedSource, string $type = 'WorkGroup'): array + public function getSearchGroups(FeedSource $feedSource, string $type = 'Department'): array { try { $responseData = $this->getSearchGroupsPage($feedSource, $type)->toArray();