Skip to content

Commit

Permalink
refactor: 불필요한 flush 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
yoondgu committed Nov 1, 2023
1 parent 7512b63 commit 0073ed2
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,13 @@ private void validateCopyablePins(AuthMember member, List<Pin> originalPins) {
public Long merge(AuthMember member, TopicMergeRequest request) {
Topic topic = convertToTopic(member, request);
List<Topic> originalTopics = findAllTopics(request.topics());

validateCopyableTopics(member, originalTopics);

List<Pin> originalPins = getAllPinsFromTopics(originalTopics);

topic.increasePinCount(originalPins.size());
topic.updateLastPinUpdatedAt(LocalDateTime.now());

topicRepository.save(topic);
topicRepository.flush();
pinRepository.saveAllToTopic(topic, originalPins);
return topic.getId();
}
Expand Down

0 comments on commit 0073ed2

Please sign in to comment.