Cockpit integration

This commit is contained in:
2024-11-07 21:34:32 +01:00
parent d3eccf99f0
commit a4b336b3fd
8 changed files with 153 additions and 41 deletions

View File

@@ -68,8 +68,9 @@ class CockpitApi
/**
* @throws GuzzleException
* @throws Exception
* @return Article[]
*/
public function getArticles(): Article|array
public function getArticles(): array
{
$res = $this->client->request('GET', $this->getApiPath('itemsByModel', ['model' => 'article']), [
'headers' => [
@@ -130,7 +131,6 @@ class CockpitApi
$return = [];
foreach ($array['data'] as $data) {
$json = json_encode($data);
dump($json);
$return[] = SerializerBuilder::create()->build()->deserialize($json, $type, 'json');
}