Removed dead code

This commit is contained in:
Charles 2026-02-11 15:16:25 +01:00
parent d089815069
commit 42bee789ba
2 changed files with 7 additions and 7 deletions

View File

@ -20,7 +20,7 @@ class MercureController extends AbstractController
public function getMercureToken(Request $request): JsonResponse
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$user = $this->userService->getUserByIdentifier($this->getUser()->getUserIdentifier());
$user =$this->getUser();
$domain = $request->getSchemeAndHttpHost();

View File

@ -29,7 +29,7 @@ class NotificationController extends AbstractController
public function index(): JsonResponse
{
$this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN');
$user = $this->userService->getUserByIdentifier($this->getUser()->getUserIdentifier());
$user =$this->getUser();
$notifications = $this->notificationRepository->findRecentByUser($user, 50);
$unreadCount = $this->notificationRepository->countUnreadByUser($user);
@ -44,7 +44,7 @@ class NotificationController extends AbstractController
public function unread(): JsonResponse
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$user = $this->userService->getUserByIdentifier($this->getUser()->getUserIdentifier());
$user =$this->getUser();
$notifications = $this->notificationRepository->findUnreadByUser($user);
$unreadCount = count($notifications);
@ -59,7 +59,7 @@ class NotificationController extends AbstractController
public function count(): JsonResponse
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$user = $this->userService->getUserByIdentifier($this->getUser()->getUserIdentifier());
$user =$this->getUser();
$unreadCount = $this->notificationRepository->countUnreadByUser($user);
@ -70,7 +70,7 @@ class NotificationController extends AbstractController
public function markAsRead(int $id): JsonResponse
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$user = $this->userService->getUserByIdentifier($this->getUser()->getUserIdentifier());
$user =$this->getUser();
$notification = $this->notificationRepository->find($id);
@ -88,7 +88,7 @@ class NotificationController extends AbstractController
public function markAllAsRead(): JsonResponse
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$user = $this->userService->getUserByIdentifier($this->getUser()->getUserIdentifier());
$user =$this->getUser();
$count = $this->notificationRepository->markAllAsReadForUser($user);
@ -99,7 +99,7 @@ class NotificationController extends AbstractController
public function delete(int $id): JsonResponse
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$user = $this->userService->getUserByIdentifier($this->getUser()->getUserIdentifier());
$user =$this->getUser();
$notification = $this->notificationRepository->find($id);