Skip to content

Commit

Permalink
fix: favorite join 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaisqls committed Nov 15, 2023
1 parent 88cb328 commit 37a10c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class CustomQuestionRepositoryImpl(

return@run leftJoin(questionTags).on(questionTags.problems.eq(questions.problem))
.leftJoin(tags).on(tags.id.eq(questionTags.id.tagId))
.leftJoin(favorite).on(favorite.problem.id.eq(questions.problem.id))
.leftJoin(favorite).on(favorite.problem.id.eq(questionSets.problem.id).and(favorite.user.id.eq(user.id)))
.leftJoin(answers).on(answers.writer.eq(user).and(answers.questions.eq(questions)))
.innerJoin(author).on(author.eq(questions.author))
.transform(
Expand Down Expand Up @@ -198,6 +198,7 @@ class CustomQuestionRepositoryImpl(
.leftJoin(tags).on(tags.id.eq(questionTags.id.tagId))
.leftJoin(answers).on(answers.questions.id.eq(questions.id))
.innerJoin(writer).on(writer.id.eq(user.id))
.leftJoin(favorite).on(favorite.problem.id.eq(questionSets.problem.id).and(favorite.user.id.eq(user.id)))
.transform(
GroupBy.groupBy(questions)
.list(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ class QuestionService(
val user = SecurityUtil.getCurrentUser()

val question = questionsRepository.findByIdOrNull(questionId)?: throw QuestionNotFoundException

val post = postRepository.save(Post())

answersRepository.save(
Expand Down

0 comments on commit 37a10c8

Please sign in to comment.