Commit 18acc531 authored by Andrea Ruggiero's avatar Andrea Ruggiero
Browse files

fix

parent d95a622a
Pipeline #1554 failed with stage
in 0 seconds
......@@ -16,7 +16,7 @@ class EventRepository extends BaseRepository
$events = $this->db()->where('title', $event->title)->where('date', $event->date)->where('start', $event->start)->where('end', $event->end)->get();
$places = [];
foreach ($events as $event) {
if ($event->place === null) {
if ($event->place_id === null) {
return array_map(function($place) {
return [
"place" => $place->name,
......@@ -27,7 +27,7 @@ class EventRepository extends BaseRepository
];
}, $placeRepository->all());
} else {
$place = $placeRepository->getById($event->event_id);
$place = $placeRepository->getById($event->place_id);
$places[] = [
"place" => $place->name,
"capacity" => $place->capacity,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment