Skip to content

Commit

Permalink
[hotfix] fix: 노트 단건 조회 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
elive7 committed Nov 24, 2024
1 parent ecaaee2 commit 68a4c67
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ public Optional<Note> findById(Long id, Long userId) {
.join(note.song).fetchJoin()
.join(song.artist).fetchJoin()
.leftJoin(note.comments, comment).fetchJoin()
.leftJoin(block)
.on(block.blocked.eq(comment.writer)
.and(block.blocker.id.eq(userId))
.and(block.deletedAt.isNull()))
.where(
note.id.eq(id),
note.deletedAt.isNull(),
comment.isNull()
.or(comment.writer.notIn(
JPAExpressions.select(block.blocked)
.from(block)
.where(block.blocker.id.eq(userId).and(block.deletedAt.isNull()))
))
block.id.isNull()
)
.fetchOne()
);
Expand Down

0 comments on commit 68a4c67

Please sign in to comment.