Skip to content

Commit

Permalink
fix : 유저 신고 시 pk값으로 조회하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
bongsh0112 committed Nov 26, 2023
1 parent daf2fcc commit d3f54fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public class CreateUserReportUseCase {
@Transactional
public void execute(Long userId) {
Long currentUserId = SecurityUtils.getCurrentUserId();
userValidator.isValidUserId(userAdaptor.query(userId).getUserId());
userReportAdaptor.save(
UserReport.builder().fromUserId(currentUserId).toUserId(userId).build());
UserReport.builder().fromUserId(currentUserId).toUserId(userAdaptor.query(userId).getId()).build());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ public void isBlocked(Long fromUserId, Long toUserId) {
.orElseThrow(() -> new BaseException(USER_BLOCK_NOT_FOUND_ERROR));
}

public void isValidUserId(String userId) {
public void isValidUserId(Long userId) {
userAdaptor
.queryByUserId(userId)
.orElseThrow(() -> new BaseException(USER_NOT_FOUND_ERROR));
.query(userId);
}
}

0 comments on commit d3f54fe

Please sign in to comment.