Anschrift für Veranstaltungsort
This commit is contained in:
@@ -13,6 +13,8 @@ class UpdateEventCommand {
|
||||
|
||||
$this->request->event->name = $this->request->eventName;
|
||||
$this->request->event->location = $this->request->eventLocation;
|
||||
$this->request->event->street = $this->normalizeOptional($this->request->street);
|
||||
$this->request->event->house_number = $this->normalizeOptional($this->request->houseNumber);
|
||||
$this->request->event->postal_code = $this->request->postalCode;
|
||||
$this->request->event->email = $this->request->email;
|
||||
$this->request->event->early_bird_end = $this->request->earlyBirdEnd;
|
||||
@@ -42,4 +44,15 @@ class UpdateEventCommand {
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Straße und Hausnummer sind optional. Ein geleertes Eingabefeld liefert einen leeren String --
|
||||
* gespeichert wird dafür `null`, damit „nicht angegeben" nur eine Darstellung hat.
|
||||
*/
|
||||
private function normalizeOptional(?string $value): ?string
|
||||
{
|
||||
$value = trim((string) $value);
|
||||
|
||||
return '' === $value ? null : $value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user