Skip to content

Commit

Permalink
fix: report 중복 접수
Browse files Browse the repository at this point in the history
  • Loading branch information
woo0doo committed Sep 9, 2023
1 parent b7f4482 commit b161a2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

public interface ReportRepository extends JpaRepository<Report, Long> {

boolean existsByReporterAndReportedUserAndReportTargetAndTargetIdAndIsCheckedNull(User reporterUser, User reportedUser, ReportTarget reportTarget, Long TargetId);
List<Report> findAllByIsCheckedFalse();
boolean existsByReporterAndReportedUserAndReportTargetAndTargetIdAndIsCheckedFalse(User reporterUser, User reportedUser, ReportTarget reportTarget, Long TargetId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ReportIdResponse createReport(Long userId, ReportRequest reportRequest) {
checkIsReport(reportedUser);
Report report = reportRequest.toEntity(reporter, reportedUser);
checkExistSpotOrComment(report.getReportTarget(), report.getTargetId(), reportedUser);
boolean exists = reportRepository.existsByReporterAndReportedUserAndReportTargetAndTargetIdAndIsCheckedNull(
boolean exists = reportRepository.existsByReporterAndReportedUserAndReportTargetAndTargetIdAndIsCheckedFalse(
reporter, reportedUser, report.getReportTarget(), report.getTargetId());
if (exists) throw new ReportException(StatusCode.REPORT_DUPLICATION);

Expand Down

0 comments on commit b161a2a

Please sign in to comment.