Skip to content

Commit

Permalink
fix: 신고 중복처리
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmondBreez3 committed Jan 30, 2024
1 parent b695ca9 commit 5196298
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public List<PopcornReviewResponse> reviewResponseList(@PathVariable("popcornId")

//TODO 팝콘작 리뷰
@Operation(summary = "팝콘작 리뷰 신고하기", description = "팝콘작 리뷰 신고하기")
@GetMapping("/review/complain/{popcornUserId}")
@PostMapping("/review/complain/{popcornUserId}")
public void reviewsFromPopcorn(@PathVariable("popcornUserId") Long popcornUserId)
{
postPopcornReviewComplainUseCase.execute(popcornUserId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ public void save(Long userId,Long reportedUserId, Long reviewId,Long popcornRevi
}

private void validateUser(Long userId, Long reviewId,Long popcornReviewId) {
if(blockRepository.existsByUserIdAndScreeningReviewId(userId,reviewId)||blockRepository.existsByUserIdAndPopcornReviewId(userId,popcornReviewId)) {
throw DuplicateBlockRequest.EXCEPTION;
System.out.println(blockRepository.existsByUserIdAndPopcornReviewId(userId,popcornReviewId));;
if (reviewId == null) {
if(blockRepository.existsByUserIdAndPopcornReviewId(userId,popcornReviewId)) {
throw DuplicateBlockRequest.EXCEPTION;
}
} else if(popcornReviewId==null) {
if(blockRepository.existsByUserIdAndScreeningReviewId(userId,reviewId)) {
throw DuplicateBlockRequest.EXCEPTION;
}
}

}
}

0 comments on commit 5196298

Please sign in to comment.