diff --git a/src/main/java/com/integrated/techhub/pr/application/PullRequestService.java b/src/main/java/com/integrated/techhub/pr/application/PullRequestService.java index 94c0472..04f9346 100644 --- a/src/main/java/com/integrated/techhub/pr/application/PullRequestService.java +++ b/src/main/java/com/integrated/techhub/pr/application/PullRequestService.java @@ -53,7 +53,7 @@ private List getStepInTitle(final String title) { private void isNotExistSave(final List newPrs) { for (PullRequest newPr : newPrs) { - if (!pullRequestRepository.existsByTitle(newPr.getTitle())) { + if (!pullRequestRepository.existsByStepIdAndTitle(newPr.getStepId(), newPr.getTitle())) { pullRequestRepository.save(newPr); } } diff --git a/src/main/java/com/integrated/techhub/pr/domain/repository/PullRequestRepository.java b/src/main/java/com/integrated/techhub/pr/domain/repository/PullRequestRepository.java index 9bb981f..ba4a13e 100644 --- a/src/main/java/com/integrated/techhub/pr/domain/repository/PullRequestRepository.java +++ b/src/main/java/com/integrated/techhub/pr/domain/repository/PullRequestRepository.java @@ -5,6 +5,6 @@ public interface PullRequestRepository extends JpaRepository { - boolean existsByTitle(final String title); + boolean existsByStepIdAndTitle(final Long stepId, final String title); }