Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 팔로우 해제 API 구현 #78

Merged
merged 2 commits into from
Feb 8, 2024
Merged

feat: 팔로우 해제 API 구현 #78

merged 2 commits into from
Feb 8, 2024

Conversation

kdkdhoho
Copy link
Collaborator

@kdkdhoho kdkdhoho commented Feb 7, 2024

Description

  • 팔로우 해제 API를 구현했습니다.
  • Path에 followingUserId를 받고, AccessToken으로 follwerUser를 식별합니다.
    그리고 Follow 테이블에서 위 두 User를 이용해 데이터를 삭제하는 방식으로 구현했습니다.

Relation Issues

@kdkdhoho kdkdhoho added the 기능 label Feb 7, 2024
@kdkdhoho kdkdhoho self-assigned this Feb 7, 2024
@kdkdhoho kdkdhoho requested a review from pparkjs as a code owner February 7, 2024 02:17
@kdkdhoho kdkdhoho linked an issue Feb 7, 2024 that may be closed by this pull request
Copy link
Collaborator

@pparkjs pparkjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

팔로우 해제 구현 잘하셨습니다!

Comment on lines +92 to +95

public void unfollow(Long followingUserId, String accessToken) {
User followingUser = userRepository.getById(followingUserId);

Long loginUserId = jwtManager.read(accessToken);
User followerUser = userRepository.getById(loginUserId);

followRepository.deleteByFollowingUserAndFollowerUser(followingUser, followerUser);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

팔로우 해제 또한 깔끔하게 잘 구현하셨네요!

@kdkdhoho kdkdhoho merged commit 5491a23 into dev Feb 8, 2024
1 check passed
@kdkdhoho kdkdhoho deleted the feat/67 branch February 8, 2024 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

팔로우 해제 API 구현
2 participants