Skip to content

Commit 1e65732

Browse files
authored
Merge pull request #178 from slid-todo/feature/follow
fix : 팔로우한 사람 인증글 목록 조회 쿼리 수정
2 parents fb365fb + b41ac4f commit 1e65732

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/java/com/codeit/todo/repository/CompleteRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ public interface CompleteRepository extends JpaRepository<Complete, Integer> {
1515
@Query("select c from Complete c where c.todo.goal.user.userId in :userIds order by c.createdAt desc")
1616
Slice<Complete> findByFollowees(@Param("userIds") List<Integer> userIds, Pageable pageable);
1717

18-
@Query("select c from Complete c where c.todo.goal.user.userId in :userIds and c.completeId > :completeId order by c.createdAt desc")
18+
@Query("select c from Complete c where c.todo.goal.user.userId in :userIds and c.completeId < :completeId order by c.createdAt desc")
1919
Slice<Complete> findByFolloweesAfterCompleteId(@Param("userIds")List<Integer> followeeIds, @Param("completeId") Integer completeId, Pageable pageable);
2020
}

src/main/java/com/codeit/todo/web/dto/response/follow/ReadFollowResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@Builder
99
public record ReadFollowResponse(
1010
int completeId,
11+
int userId,
1112
String completePic,
1213
String completeContent,
1314
String profilePic,
@@ -22,6 +23,7 @@ public record ReadFollowResponse(
2223
public static ReadFollowResponse from(Complete complete, Boolean likeStatus) {
2324
return ReadFollowResponse.builder()
2425
.completeId(complete.getCompleteId())
26+
.userId(complete.getTodo().getGoal().getUser().getUserId())
2527
.completePic(complete.getCompletePic())
2628
.completeContent(complete.getNote())
2729
.profilePic(complete.getTodo().getGoal().getUser().getProfilePic())

0 commit comments

Comments
 (0)