Skip to content

Commit

Permalink
⚡️ :: filtering 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
gurdl0525 committed Nov 15, 2023
1 parent 459a499 commit 7bb54f0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ class TimelineServiceImpl(
@Transactional
override fun comment(timelineId: UUID, comment: String): CommentResponse {

val user = userFacade.getCurrentUser()

val timeline = diaryRepository.findByIdAndIsPosted(timelineId, true) ?: throw TimelineNotFoundException

return commentRepository.save(Comment(comment, userFacade.getCurrentUser(), timeline)).toResponse()
val commented = commentRepository.save(Comment(comment, userFacade.getCurrentUser(), timeline))

return if (user.onFiltering) commented.toFilteringResponse(badWordFiltering) else commented.toResponse()
}

override fun getComment(timelineId: UUID): CommentListResponse {
Expand Down

0 comments on commit 7bb54f0

Please sign in to comment.