diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/group_capsule/service/GroupCapsuleService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/group_capsule/service/GroupCapsuleService.java index 7476b98d6..6b6e88594 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/group_capsule/service/GroupCapsuleService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/group_capsule/service/GroupCapsuleService.java @@ -2,10 +2,13 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; +import java.util.Collections; import java.util.List; import lombok.RequiredArgsConstructor; import org.locationtech.jts.geom.Point; import org.springframework.data.domain.Slice; +import org.springframework.data.domain.SliceImpl; +import org.springframework.security.core.parameters.P; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import site.timecapsulearchive.core.domain.capsule.data.dto.CapsuleBasicInfoDto; @@ -199,6 +202,10 @@ public Slice findGroupCapsuleSlice( ) { final List groupIds = memberGroupRepository.findGroupIdsByMemberId(memberId); + if (groupIds.isEmpty()) { + return new SliceImpl<>(Collections.emptyList()); + } + return groupCapsuleQueryRepository.findGroupCapsuleSlice(size, lastCapsuleId, groupIds); }