Skip to content

Commit

Permalink
Feat: 단일 피드 조회, 조회용 테이블 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
jzakka committed Apr 9, 2024
1 parent ef31f72 commit 2a006c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/stoury/service/FeedService.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ public void deleteFeedIfOwner(Long feedId, Long memberId) {

@Transactional(readOnly = true)
public FeedResponse getFeed(Long feedId) {
Feed feed = feedRepository.findById(Objects.requireNonNull(feedId))
Long feedIdNonNull = Objects.requireNonNull(feedId);
FeedResponseEntity feedResponseEntity = feedRepository.findFeedResponseById(feedIdNonNull)
.orElseThrow(FeedSearchException::new);
long likes = likeRepository.getCountByFeedId(feed.getId().toString());

return FeedResponse.from(feed, likes);
return toFeedResponse(feedResponseEntity);
}
}

0 comments on commit 2a006c0

Please sign in to comment.