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(), + ]); } }