From ab0ad3725125e39d527331312bd11fa87e932cdb Mon Sep 17 00:00:00 2001 From: Vladik Date: Fri, 25 Oct 2024 15:39:49 +0300 Subject: [PATCH] refactor ChatController.java --- .../com/chat/yourway/controller/websocket/ChatController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/chat/yourway/controller/websocket/ChatController.java b/src/main/java/com/chat/yourway/controller/websocket/ChatController.java index d62d733..b6db66d 100644 --- a/src/main/java/com/chat/yourway/controller/websocket/ChatController.java +++ b/src/main/java/com/chat/yourway/controller/websocket/ChatController.java @@ -26,12 +26,11 @@ public MessageResponseDto sendMessage(@DestinationVariable UUID topicId, Message log.info("Received message for topic ID: {}", topicId); - MessageResponseDto sendMessage = messageService.sendToTopic(topicId, message); log.info("Message was saved in DB"); messagingTemplate.convertAndSend("/topic/public/" + topicId, message); log.info("Message sent to topic ID: {}", topicId) ; - return sendMessage; + return messageService.sendToTopic(topicId, message); } }