From 2a2e0ab218699405adcfed56008ad4e02a0ebd26 Mon Sep 17 00:00:00 2001 From: Vladik-gif Date: Fri, 27 Sep 2024 11:26:05 +0300 Subject: [PATCH] fix: Updated TopicService.getPrivateTopic and delete method TopicService.generatePrivateName --- src/main/java/com/chat/yourway/service/TopicService.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/chat/yourway/service/TopicService.java b/src/main/java/com/chat/yourway/service/TopicService.java index ee37ae5..9239149 100644 --- a/src/main/java/com/chat/yourway/service/TopicService.java +++ b/src/main/java/com/chat/yourway/service/TopicService.java @@ -165,10 +165,6 @@ public List findTopicsByTopicName(String topicName) { return toListResponseDto(topicRepository.findAllByName(topicName), contactService.getCurrentContact()); } - private String generatePrivateName(String sendTo, String email) { - return UUID.randomUUID().toString(); - } - public List findAllFavouriteTopics() { Contact contact = contactService.getCurrentContact(); return toListInfoResponseDto(contact.getFavoriteTopics(), contact); @@ -185,7 +181,7 @@ public Topic getPrivateTopic(Contact sendToContact, Contact sendFromContact) { () -> { Topic newPrivateTopic = Topic.builder() .contact(sendToContact) - .name(generatePrivateName(sendToContact.getEmail(), sendFromContact.getEmail())) + .name(sendFromContact.getNickname()) .scope(TopicScope.PRIVATE) .topicSubscribers(List.of(sendToContact, sendFromContact)) .build();