From bbed8ad35cea1515bae92d9f1761586d6f3aef95 Mon Sep 17 00:00:00 2001 From: Jiwon-cho Date: Sat, 2 Mar 2024 00:47:15 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20query=20=EC=A1=B0=ED=9A=8C=EB=AC=B8?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/mara/server/domain/share/ShareRepository.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/mara/server/domain/share/ShareRepository.kt b/src/main/kotlin/mara/server/domain/share/ShareRepository.kt index 77f5361..758919a 100644 --- a/src/main/kotlin/mara/server/domain/share/ShareRepository.kt +++ b/src/main/kotlin/mara/server/domain/share/ShareRepository.kt @@ -98,13 +98,13 @@ class CustomShareRepositoryImpl( .fetch() val query = queryFactory.selectFrom(share) - .where(share.id.`in`(appliedShareIdList).and(share.user.eq(user).and(share.status.eq(status)))) + .where((share.id.`in`(appliedShareIdList).or(share.user.eq(user)).and(share.status.eq(status)))) .offset(pageable.offset) .limit(pageable.pageSize.toLong()) .orderBy(share.createdAt.desc()).fetch() val count = queryFactory.select(share.count()).from(share) - .where(share.id.`in`(appliedShareIdList).and(share.user.eq(user).and(share.status.eq(status)))).fetchOne() + .where((share.id.`in`(appliedShareIdList).or(share.user.eq(user)).and(share.status.eq(status)))).fetchOne() return PageableExecutionUtils.getPage(query, pageable) { count!! } }