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); } }