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

hotfix: 좋아요/싫어요 취소 시, 싫어요 취소해도 좋아요 통계 줄어드는 오류 수정 #473

Merged
merged 1 commit into from
Oct 15, 2023

Conversation

dooboocookie
Copy link
Collaborator

📌 관련 이슈

🛠️ 작업 내용

PR에서 작업한 주요 내용을 적어주세요.

  • 좋아요/싫어요 취소 시, 싫어요 취소해도 좋아요 통계 줄어드는 오류 수정
  • 그에 대한 테스트

🎯 리뷰 포인트

hotfix입니다.

지난번 좋아요/싫어요 삭제 PR에 대한 수정입니다.

좋아요를 삭제할 때만 좋아요 개수를 한개 줄여야되는데,
싫어요를 삭제할 때도 좋아요 개수를 한개 줄이는 오류 수정입니다.

⏳ 작업 시간

추정 시간: 30분
실제 시간: 15분

@github-actions
Copy link
Contributor

Unit Test Results

149 tests   149 ✔️  14s ⏱️
  33 suites      0 💤
  33 files        0

Results for commit edde64c.

Copy link
Collaborator

@kokodak kokodak left a comment

Choose a reason for hiding this comment

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

리뷰할 때 이걸 놓쳤었네요..

잘 바꿔주신 것 같아서 바로 Approve 하겠습니다 -

Comment on lines +124 to +129
final Optional<PlaceLike> findPlaceLike = placeLikeRepository.findById(placeLike.getId());
final PlaceStatistics findPlaceStatistics = placeStatisticsRepository.findByPlaceId(place.getId()).get();
assertSoftly(softAssertions -> {
assertThat(findPlaceStatistics.getLikeCount()).isEqualTo(beforeLikeCount);
assertThat(findPlaceLike).isEmpty();
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

검증 굿

Copy link
Collaborator

@chaewon121 chaewon121 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 +47 to +51
private void subtractPlaceLikeCount(final Long placeId, final PlaceLike placeLike) {
if(placeLike.getType() == PlaceLikeType.LIKE) {
final SubtractLikeCommand subtractLikeCommand = new SubtractLikeCommand(placeId);
placeStatisticsService.subtractLike(subtractLikeCommand);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

저희 enum앞에 클래스명을 붙이지 않는것이 컨밴션이였던것으로 기억합니다!

@dooboocookie dooboocookie merged commit b5293b9 into dev_backend Oct 15, 2023
3 checks passed
@dooboocookie dooboocookie deleted the fix/#472 branch October 16, 2023 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants