From 9201dccff8ad6c32d406473d4a5d4c039b5a0950 Mon Sep 17 00:00:00 2001 From: Tom Udding Date: Thu, 2 Jan 2025 16:08:42 +0100 Subject: [PATCH] fix(company): not requiring logo when creating a company Logo is not required when updating a company. --- module/Company/src/Service/Company.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/Company/src/Service/Company.php b/module/Company/src/Service/Company.php index 909dfbd674..d175fc8807 100644 --- a/module/Company/src/Service/Company.php +++ b/module/Company/src/Service/Company.php @@ -349,7 +349,7 @@ public function createCompany(array $data): CompanyModel|bool } // Upload the logo of the company. - if (!$this->uploadFile($company, $data['logo'])) { + if (!$this->uploadFile($company, $data['logo'], required: true)) { return false; } @@ -420,9 +420,10 @@ private function uploadFile( CompanyModel|CompanyPackageModel|JobModel $entity, ?array $file, string $languageSuffix = '', + bool $required = false, ): bool { if (null === $file) { - return true; + return !$required; } // Check if there is an actual file and no errors occurred during the upload. @@ -535,7 +536,7 @@ public function createPackage( $package->setCompany($company); if (CompanyPackageTypes::Banner === $type) { - if (!$this->uploadFile($package, $data['banner'])) { + if (!$this->uploadFile($package, $data['banner'], required: true)) { return false; } }