Skip to content

Commit

Permalink
[Fix]: 친구 신청 확인 변수명 수정 (#121)
Browse files Browse the repository at this point in the history
friendId를 memberId로 수정

Related to: #120
  • Loading branch information
onpyeong authored Mar 20, 2024
1 parent 5da2f04 commit 6427fb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ public UpdateFriendNameResponse updateFriendName(Long userId, Long friendId, Upd
}

@Transactional
public Boolean checkFriendRequest(Long userId, Long friendId) {
public Boolean checkFriendRequest(Long userId, Long memberId) {

boolean AlreadyFriendRequest = false;

UserServiceUtil.existsUserById(userRepository, userId);
UserServiceUtil.existsUserById(userRepository, friendId);
UserServiceUtil.existsUserById(userRepository, memberId);

if (friendQueryRepository.isAlreadyFriend(userId, friendId) || noticeRepository.existsBySenderIdAndReceiverIdAndIsOkay(userId, friendId, NoticeStatus.WAITING)) {
if (friendQueryRepository.isAlreadyFriend(userId, memberId) || noticeRepository.existsBySenderIdAndReceiverIdAndIsOkay(userId, memberId, NoticeStatus.WAITING)) {
AlreadyFriendRequest = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,21 @@ public ResponseEntity<ApiResponse<UpdateFriendNameResponse>> updateFriendName(
));
}

@GetMapping("/request/{friendId}")
@GetMapping("/request/{memberId}")
@Operation(
summary = "친구 신청 여부 확인 API 메서드",
description = "친구 신청을 했는지 확인하는 메서드입니다."
)
public ResponseEntity<ApiResponse<Boolean>> checkFriendRequest(
@AuthenticationPrincipal User user,
@PathVariable Long friendId
@PathVariable Long memberId
) {

return ResponseEntity
.status(HttpStatus.OK)
.body(ApiResponse.success(
SuccessCode.GET_REQUEST_FRIEND_SUCCESS,
friendService.checkFriendRequest(user.getId(), friendId)
friendService.checkFriendRequest(user.getId(), memberId)
));
}
}

0 comments on commit 6427fb1

Please sign in to comment.