Skip to content

Commit 3c725c6

Browse files
committed
Fix event address not being cleared when switching to an online event
1 parent a6893f5 commit 3c725c6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

backend/app/Services/Handlers/EventSettings/PartialUpdateEventSettingsHandler.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ public function handle(PartialUpdateEventSettingsDTO $eventSettingsDTO): EventSe
3131
throw new RefundNotPossibleException('Event settings not found');
3232
}
3333

34+
$locationDetails = $eventSettingsDTO->settings['location_details'] ?? $existingSettings->getLocationDetails();
35+
$isOnlineEvent = $eventSettingsDTO->settings['is_online_event'] ?? $existingSettings->getIsOnlineEvent();
36+
37+
if ($isOnlineEvent) {
38+
$locationDetails = null;
39+
}
40+
3441
return $this->eventSettingsHandler->handle(
3542
UpdateEventSettingsDTO::fromArray([
3643
'event_id' => $eventSettingsDTO->event_id,
@@ -59,7 +66,7 @@ public function handle(PartialUpdateEventSettingsDTO $eventSettingsDTO): EventSe
5966
'order_timeout_in_minutes' => $eventSettingsDTO->settings['order_timeout_in_minutes'] ?? $existingSettings->getOrderTimeoutInMinutes(),
6067
'website_url' => $eventSettingsDTO->settings['website_url'] ?? $existingSettings->getWebsiteUrl(),
6168
'maps_url' => $eventSettingsDTO->settings['maps_url'] ?? $existingSettings->getMapsUrl(),
62-
'location_details' => $eventSettingsDTO->settings['location_details'] ?? $existingSettings->getLocationDetails(),
69+
'location_details' => $locationDetails,
6370
'is_online_event' => $eventSettingsDTO->settings['is_online_event'] ?? $existingSettings->getIsOnlineEvent(),
6471
'online_event_connection_details' => array_key_exists('online_event_connection_details', $eventSettingsDTO->settings)
6572
? $eventSettingsDTO->settings['online_event_connection_details']

0 commit comments

Comments
 (0)