Skip to content

Commit

Permalink
fix: null 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaisqls committed Oct 10, 2023
1 parent 5a83560 commit 1cce5eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ data class AnswerRequest(
data class GetQuestionListRequest(
val category: Category?,
val keyword: String?,
val tags: List<String>,
val tags: List<String>?,
val page: Long
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class QuestionService(
page = page,
category = category,
keyword = keyword,
tagList = tags
tagList = tags ?: listOf()
)
}

Expand Down

0 comments on commit 1cce5eb

Please sign in to comment.