Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shem8 committed Jan 22, 2024
1 parent 438b634 commit 2baf9e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/src/main/java/io/spring/api/CommentsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public ResponseEntity deleteComment(
.findById(item.getId(), commentId)
.map(
comment -> {
if (item.getSellerId() != comment.getUserId()) {
throw new ResponseStatusException(HttpStatus.FORBIDDEN);
}
commentRepository.remove(comment);
return ResponseEntity.noContent().build();
})
Expand Down

0 comments on commit 2baf9e6

Please sign in to comment.