From 42bee789ba6ee0a16080d1326860a6221805415c Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 11 Feb 2026 15:16:25 +0100 Subject: [PATCH] Removed dead code --- src/Controller/MercureController.php | 2 +- src/Controller/NotificationController.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Controller/MercureController.php b/src/Controller/MercureController.php index 096871b..93548ae 100644 --- a/src/Controller/MercureController.php +++ b/src/Controller/MercureController.php @@ -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(); diff --git a/src/Controller/NotificationController.php b/src/Controller/NotificationController.php index 9195577..9d32d6c 100644 --- a/src/Controller/NotificationController.php +++ b/src/Controller/NotificationController.php @@ -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);