diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f1ba5b3..4ebcf0ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). this package and not the cluster API. See the changelog of the [cluster API](https://cluster-api.cyberfusion.nl/redoc#section/Changelog) for detailed information. +## [1.86.3] + +### Fixed + +- Fix `filterFields` when no specific fields are passed + ## [1.86.2] ### Fixed diff --git a/src/Client.php b/src/Client.php index a76112a9..ef32e07e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -20,7 +20,7 @@ class Client implements ClientContract { private const CONNECT_TIMEOUT = 60; private const TIMEOUT = 180; - private const VERSION = '1.86.2'; + private const VERSION = '1.86.3'; private const USER_AGENT = 'cyberfusion-cluster-api-client/' . self::VERSION; private Configuration $configuration; diff --git a/src/Endpoints/Endpoint.php b/src/Endpoints/Endpoint.php index 09004b23..ee2f75d8 100644 --- a/src/Endpoints/Endpoint.php +++ b/src/Endpoints/Endpoint.php @@ -57,6 +57,10 @@ protected function validateRequired(Model $model, string $action, array $require */ protected function filterFields(array $array, array $fields = []): array { + if (count($fields) === 0) { + return array_filter($array); + } + return Arr::only($array, $fields); } }