fix(home): 팔로잉 크리에이터를 오래된 팔로우순으로 조회한다

This commit is contained in:
2026-07-12 16:43:20 +09:00
parent 66973cf80b
commit 7e22b92bc9
2 changed files with 5 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ class DefaultHomeFollowingQueryRepository(
creator.role.eq(MemberRole.CREATOR), creator.role.eq(MemberRole.CREATOR),
notBlockedCreatorCondition(memberId, creator.id) notBlockedCreatorCondition(memberId, creator.id)
) )
.orderBy(creatorFollowing.createdAt.desc(), creatorFollowing.id.desc()) .orderBy(creatorFollowing.createdAt.asc(), creatorFollowing.id.desc())
.limit(limit.toLong()) .limit(limit.toLong())
.fetch() .fetch()
.map { row -> .map { row ->

View File

@@ -39,8 +39,8 @@ class DefaultHomeFollowingQueryRepositoryTest @Autowired constructor(
private val repository = DefaultHomeFollowingQueryRepository(queryFactory, "https://cdn.test") private val repository = DefaultHomeFollowingQueryRepository(queryFactory, "https://cdn.test")
@Test @Test
@DisplayName("팔로잉 크리에이터는 활성 팔로우와 활성 크리에이터만 최신 팔로우순으로 조회한다") @DisplayName("팔로잉 크리에이터는 활성 팔로우와 활성 크리에이터만 오래된 팔로우순으로 조회한다")
fun shouldFindActiveFollowingCreatorsByLatestFollowOrder() { fun shouldFindActiveFollowingCreatorsByOldestFollowOrder() {
val viewer = saveMember("following-viewer", MemberRole.USER) val viewer = saveMember("following-viewer", MemberRole.USER)
val activeCreator = saveMember("following-active", MemberRole.CREATOR, profileImage = "active.png") val activeCreator = saveMember("following-active", MemberRole.CREATOR, profileImage = "active.png")
val inactiveCreator = saveMember("following-inactive", MemberRole.CREATOR, isActive = false) val inactiveCreator = saveMember("following-inactive", MemberRole.CREATOR, isActive = false)
@@ -57,8 +57,8 @@ class DefaultHomeFollowingQueryRepositoryTest @Autowired constructor(
val creators = repository.findFollowingCreators(memberId = viewer.id!!, limit = 20) val creators = repository.findFollowingCreators(memberId = viewer.id!!, limit = 20)
assertEquals(listOf(activeCreator.id!!, olderCreator.id!!), creators.map { it.creatorId }) assertEquals(listOf(olderCreator.id!!, activeCreator.id!!), creators.map { it.creatorId })
assertEquals("https://cdn.test/active.png", creators.first().creatorProfileImageUrl) assertEquals("https://cdn.test/active.png", creators.last().creatorProfileImageUrl)
} }
@Test @Test