Skip to content

Commit

Permalink
fix: 팔로잉 조회 API 명세 변경에 따른 로직 변경 (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdkdhoho committed Feb 8, 2024
1 parent 8b8e3c4 commit fa0b455
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ public AllUserResponse getAllUser() {
return AllUserResponse.of(allUser);
}

public FollowingsResponse getFollowings(String accessToken) {
Long loginUserId = jwtManager.read(accessToken);
User user = userRepository.getById(loginUserId);
public FollowingsResponse getFollowings(Long userId) {
User user = userRepository.getById(userId);
List<Follow> follows = followRepository.getAllByFollowerUser(user);

List<User> followingUsers = follows.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ ResponseEntity<AllUserListsResponse> getAllUserLists(
return ResponseEntity.ok(allUserListsResponse);
}

@GetMapping("/followings")
ResponseEntity<FollowingsResponse> getFollowings(@RequestHeader(value = AUTHORIZATION) String accessToken) {
FollowingsResponse response = userService.getFollowings(accessToken);
@GetMapping("/users/{userId}/followings")
ResponseEntity<FollowingsResponse> getFollowings(@PathVariable(name = "userId") Long userId) {
FollowingsResponse response = userService.getFollowings(userId);
return ResponseEntity.ok(response);
}

Expand Down

0 comments on commit fa0b455

Please sign in to comment.