diff --git a/src/main/kotlin/kr/hs/dsm/inq/domain/question/persistence/repository/QuestionsRepository.kt b/src/main/kotlin/kr/hs/dsm/inq/domain/question/persistence/repository/QuestionsRepository.kt index bc51cd7..52b6c6d 100644 --- a/src/main/kotlin/kr/hs/dsm/inq/domain/question/persistence/repository/QuestionsRepository.kt +++ b/src/main/kotlin/kr/hs/dsm/inq/domain/question/persistence/repository/QuestionsRepository.kt @@ -56,8 +56,8 @@ class CustomQuestionRepositoryImpl( val questionList = queryFactory .selectFrom(questions) .where( - category?.let { questions.category.eq(it) }, - (keyword ?: "").let { questions.question.contains(keyword) } + category?.let { questions.category.eq(it) + .and((keyword ?: "").let { questions.question.contains(keyword) }) } ) .orderBy(questions.likeCount.asc()) .offsetAndLimit(page) diff --git a/src/main/kotlin/kr/hs/dsm/inq/domain/question/presentation/dto/Requests.kt b/src/main/kotlin/kr/hs/dsm/inq/domain/question/presentation/dto/Requests.kt index fbe9f55..88adca8 100644 --- a/src/main/kotlin/kr/hs/dsm/inq/domain/question/presentation/dto/Requests.kt +++ b/src/main/kotlin/kr/hs/dsm/inq/domain/question/presentation/dto/Requests.kt @@ -28,7 +28,7 @@ data class AnswerRequest( data class GetQuestionListRequest( val category: Category?, val keyword: String?, - val tags: List, + val tags: List?, val page: Long ) diff --git a/src/main/kotlin/kr/hs/dsm/inq/domain/question/service/QuestionService.kt b/src/main/kotlin/kr/hs/dsm/inq/domain/question/service/QuestionService.kt index 14de1ec..46ad30d 100644 --- a/src/main/kotlin/kr/hs/dsm/inq/domain/question/service/QuestionService.kt +++ b/src/main/kotlin/kr/hs/dsm/inq/domain/question/service/QuestionService.kt @@ -130,7 +130,7 @@ class QuestionService( page = page, category = category, keyword = keyword, - tagList = tags + tagList = tags ?: listOf() ) }