Skip to content

Commit

Permalink
fix(company): not requiring logo when creating a company
Browse files Browse the repository at this point in the history
Logo is not required when updating a company.
  • Loading branch information
tomudding committed Jan 2, 2025
1 parent b1338d3 commit 9201dcc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions module/Company/src/Service/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 9201dcc

Please sign in to comment.