diff --git a/src/main/java/com/openisle/service/ReactionService.java b/src/main/java/com/openisle/service/ReactionService.java index cae386351..2b90670af 100644 --- a/src/main/java/com/openisle/service/ReactionService.java +++ b/src/main/java/com/openisle/service/ReactionService.java @@ -28,11 +28,6 @@ public class ReactionService { .orElseThrow(() -> new IllegalArgumentException("User not found")); Post post = postRepository.findById(postId) .orElseThrow(() -> new IllegalArgumentException("Post not found")); - java.util.Optional existing = - reactionRepository.findByUserAndPostAndType(user, post, type); - if (existing.isPresent()) { - return null; - } Reaction reaction = new Reaction(); reaction.setUser(user); reaction.setPost(post); @@ -49,11 +44,6 @@ public class ReactionService { .orElseThrow(() -> new IllegalArgumentException("User not found")); Comment comment = commentRepository.findById(commentId) .orElseThrow(() -> new IllegalArgumentException("Comment not found")); - java.util.Optional existing = - reactionRepository.findByUserAndCommentAndType(user, comment, type); - if (existing.isPresent()) { - return null; - } Reaction reaction = new Reaction(); reaction.setUser(user); reaction.setComment(comment);