Skip to content

Commit

Permalink
fix: 팔로잉 조회 API 명세 변경에 따른 로직 변경 (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdkdhoho authored Feb 8, 2024
1 parent ac1bb89 commit 44d0072
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 @@ -75,9 +75,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 @@ -53,9 +53,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 44d0072

Please sign in to comment.