Skip to content

Commit

Permalink
Merge pull request #748 from owlchester/api-updating-entity-removes-i…
Browse files Browse the repository at this point in the history
…mages-uuid

API: Bug updating entity removes image uuid
  • Loading branch information
ilestis authored Oct 10, 2023
2 parents bde7493 + 7ecea6d commit 632803d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Observers/EntityObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use App\Services\ImageService;
use App\Services\PermissionService;
use Illuminate\Support\Str;
use App\Facades\Domain;

class EntityObserver
{
Expand Down Expand Up @@ -227,10 +228,9 @@ public function saveBoosted(Entity $entity): void
// Gallery is now available to all
if (request()->has('entity_image_uuid')) {
$entity->image_uuid = request()->get('entity_image_uuid');
} else {
} elseif (Domain::isApp()) {
$entity->image_uuid = null;
}

// No changed for non-boosted campaigns
if (!$entity->campaign->boosted()) {
$entity->save();
Expand All @@ -249,7 +249,7 @@ public function saveBoosted(Entity $entity): void
if ($entity->campaign->superboosted()) {
if (request()->has('entity_header_uuid')) {
$entity->header_uuid = request()->get('entity_header_uuid');
} else {
} elseif (Domain::isApp()) {
$entity->header_uuid = null;
}
}
Expand Down

0 comments on commit 632803d

Please sign in to comment.