Browse Source

show events by user settings whitelist only

main
ghost 1 year ago
parent
commit
9c9dc5b5a4
  1. 4
      src/Controller/UserController.php
  2. 8
      src/Service/ActivityService.php

4
src/Controller/UserController.php

@ -57,7 +57,9 @@ class UserController extends AbstractController @@ -57,7 +57,9 @@ class UserController extends AbstractController
return $this->render(
'default/user/dashboard.html.twig',
[
'activities' => $activityService->findLastActivities()
'activities' => $activityService->findLastEvents(
$user->getEvents()
)
]
);
}

8
src/Service/ActivityService.php

@ -360,12 +360,16 @@ class ActivityService @@ -360,12 +360,16 @@ class ActivityService
return $events;
}
public function findLastActivities(): array
public function findLastEvents(
array $whitelist
): array
{
return $this->entityManagerInterface
->getRepository(Activity::class)
->findBy(
[],
[
'event' => $whitelist
],
[
'id' => 'DESC'
]

Loading…
Cancel
Save