커뮤니티 게시물 조회 - 댓글 추가 불가능한 경우 댓글조회를 하지 않도록 수정

This commit is contained in:
Klaus 2023-12-21 23:53:33 +09:00
parent 7326babc49
commit 8c5b7b811d
1 changed files with 36 additions and 24 deletions

View File

@ -149,15 +149,19 @@ class CreatorCommunityService(
} else {
0
}
val commentList = commentRepository.findByPostId(
cloudFrontHost = imageHost,
timezone = timezone,
id = it.id!!,
offset = 0,
limit = 1
)
val commentList = if (it.isCommentAvailable) {
commentRepository.findByPostId(
cloudFrontHost = imageHost,
timezone = timezone,
id = it.id!!,
offset = 0,
limit = 1
)
} else {
listOf()
}
val firstComment = if (commentList.isNotEmpty()) {
val firstComment = if (it.isCommentAvailable && commentList.isNotEmpty()) {
commentList[0]
} else {
null
@ -206,15 +210,19 @@ class CreatorCommunityService(
} else {
0
}
val commentList = commentRepository.findByPostId(
cloudFrontHost = imageHost,
timezone = timezone,
id = post.id!!,
offset = 0,
limit = 1
)
val commentList = if (post.isCommentAvailable) {
commentRepository.findByPostId(
cloudFrontHost = imageHost,
timezone = timezone,
id = post.id!!,
offset = 0,
limit = 1
)
} else {
listOf()
}
val firstComment = if (commentList.isNotEmpty()) {
val firstComment = if (post.isCommentAvailable && commentList.isNotEmpty()) {
commentList[0]
} else {
null
@ -374,15 +382,19 @@ class CreatorCommunityService(
} else {
0
}
val commentList = commentRepository.findByPostId(
cloudFrontHost = imageHost,
timezone = timezone,
id = it.id!!,
offset = 0,
limit = 1
)
val commentList = if (it.isCommentAvailable) {
commentRepository.findByPostId(
cloudFrontHost = imageHost,
timezone = timezone,
id = it.id!!,
offset = 0,
limit = 1
)
} else {
listOf()
}
val firstComment = if (commentList.isNotEmpty()) {
val firstComment = if (it.isCommentAvailable && commentList.isNotEmpty()) {
commentList[0]
} else {
null