Skip to content

Commit 0c80cfc

Browse files
authored
Merge pull request #240 from os2display/feature/colibo-fixes
Fixed issues with Colibo feed
2 parents a130ffa + 18c02f2 commit 0c80cfc

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
- [#240](https://github.com/os2display/display-api-service/pull/240)
8+
- Fixed issues with Colibo feed type.
79
- [#226](https://github.com/os2display/display-api-service/pull/226)
810
- Added Colibo feed type.
911

src/Feed/ColiboFeedType.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use App\Entity\Tenant\FeedSource;
99
use App\Feed\OutputModel\ConfigOption;
1010
use App\Feed\SourceType\Colibo\ApiClient;
11+
use App\Feed\SourceType\Colibo\SecretsDTO;
1112
use App\Service\FeedService;
1213
use FeedIo\Feed\Item;
1314
use FeedIo\Feed\Node\Category;
@@ -64,15 +65,21 @@ public function getAdminFormOptions(FeedSource $feedSource): array
6465

6566
public function getData(Feed $feed): array
6667
{
67-
$configuration = $feed->getConfiguration();
68-
$secrets = $feed->getFeedSource()?->getSecrets() ?? [];
69-
7068
$result = [
7169
'title' => 'Intranet',
7270
'entries' => [],
7371
];
7472

75-
$baseUri = $secrets['api_base_uri'];
73+
$configuration = $feed->getConfiguration();
74+
$feedSource = $feed->getFeedSource();
75+
76+
if (null == $feedSource) {
77+
return $result;
78+
}
79+
80+
$secrets = new SecretsDTO($feedSource);
81+
82+
$baseUri = $secrets->apiBaseUri;
7683
$recipients = $configuration['recipients'] ?? [];
7784
$publishers = $configuration['publishers'] ?? [];
7885
$pageSize = isset($configuration['page_size']) ? (int) $configuration['page_size'] : 10;

src/Feed/SourceType/Colibo/ApiClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function getFeedEntriesNews(FeedSource $feedSource, array $recipients = [
8484
*
8585
* @return array
8686
*/
87-
public function getSearchGroups(FeedSource $feedSource, string $type = 'WorkGroup'): array
87+
public function getSearchGroups(FeedSource $feedSource, string $type = 'Department'): array
8888
{
8989
try {
9090
$responseData = $this->getSearchGroupsPage($feedSource, $type)->toArray();

0 commit comments

Comments
 (0)