Compare commits

..

No commits in common. "9610bee8ca705eece43d104401f0841db621ac79" and "53b92624d18111049788298f2ce20ccfbb5ffdcf" have entirely different histories.

2 changed files with 4 additions and 3 deletions

@ -1 +1 @@
Subproject commit 57e0c30952ee42ce2d8a4c9fb9af4e4c709d657e Subproject commit 3f8687f95163c418e6c8c67d913961339a5e4426

View File

@ -4,9 +4,10 @@ namespace Silva\Adrema\Components;
use Cms\Classes\ComponentBase; use Cms\Classes\ComponentBase;
use Cms\Classes\Page; use Cms\Classes\Page;
use FetchAllEvents;
use Silva\Adrema\Exceptions\ComponentException; use Silva\Adrema\Exceptions\ComponentException;
use Silva\Adrema\Models\Settings; use Silva\Adrema\Models\Settings;
use Silva\Adrema\Support\FetchAllEvents; use Silva\Adrema\Support\FetchAllEvents as SupportFetchAllEvents;
class EventIndex extends ComponentBase class EventIndex extends ComponentBase
{ {
@ -39,7 +40,7 @@ class EventIndex extends ComponentBase
$this->eventSlug = $this->property('eventSlug'); $this->eventSlug = $this->property('eventSlug');
if ($this->eventSlug) { if ($this->eventSlug) {
$events = data_get(app(FetchAllEvents::class)->run(), 'data'); $events = data_get(app(SupportFetchAllEvents::class)->run(), 'data');
throw_if(is_null($events), ComponentException::class, 'event_fetching_failed'); throw_if(is_null($events), ComponentException::class, 'event_fetching_failed');
$this->event = collect($events)->first(fn ($event) => $event['slug'] === $this->eventSlug); $this->event = collect($events)->first(fn ($event) => $event['slug'] === $this->eventSlug);