From ce2eaa03e15f04c59281cad0238ca24531d64379 Mon Sep 17 00:00:00 2001 From: matthieu Date: Sun, 15 Mar 2026 19:46:10 +0100 Subject: [PATCH] feat(notification) : add unread-count and mark-all-read custom controllers --- src/Controller/MarkAllReadController.php | 31 +++++++++++++++++++ .../NotificationUnreadCountController.php | 31 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/Controller/MarkAllReadController.php create mode 100644 src/Controller/NotificationUnreadCountController.php diff --git a/src/Controller/MarkAllReadController.php b/src/Controller/MarkAllReadController.php new file mode 100644 index 0000000..ece0497 --- /dev/null +++ b/src/Controller/MarkAllReadController.php @@ -0,0 +1,31 @@ +getUser(); + + $this->notificationRepository->markAllReadByUser($user); + + return new Response(null, Response::HTTP_NO_CONTENT); + } +} diff --git a/src/Controller/NotificationUnreadCountController.php b/src/Controller/NotificationUnreadCountController.php new file mode 100644 index 0000000..dc3669f --- /dev/null +++ b/src/Controller/NotificationUnreadCountController.php @@ -0,0 +1,31 @@ +getUser(); + + $count = $this->notificationRepository->countUnreadByUser($user); + + return new JsonResponse(['count' => $count]); + } +}