From c3bc40561ba141a72b253b205bfab5f7bcb96dc5 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Wed, 1 Jan 2025 05:59:21 +0000 Subject: [PATCH] update notification reader --- src/Controller/MessageController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Controller/MessageController.php b/src/Controller/MessageController.php index 64241bc..0229ef8 100644 --- a/src/Controller/MessageController.php +++ b/src/Controller/MessageController.php @@ -21,10 +21,15 @@ class MessageController extends AbstractController #[Route('/api/notifications/{msgId}', name: 'app_read_message')] public function readMessage(string $msgId): Response { + /** @var Messages $message */ $message = $this->entityManager->getRepository(Messages::class)->find($msgId); $message->setReceived(new \DateTimeImmutable()); $this->entityManager->flush(); - return new JsonResponse(true, Response::HTTP_OK); + return $this->json([ + 'success' => true, + 'message' => 'Message marked as read', + 'link' => $message->getLink(), + ]); } }