Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
meltapplee committed Sep 18, 2024
1 parent 96d83d5 commit 5ccbbdc
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 @@ -31,7 +31,7 @@ class CreatePostService(
Post(
title = request.title,
content = request.content,
userId = user.id!!,
user = user!!,
date = LocalDateTime.now(),
schoolId = schoolId,
keyWord = keyWord,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DeletePostService(
fun execute(postId: Long) {
val user = userFacade.currentUser()
val post = postRepository.findById(postId) ?: throw PostNotFoundException
if (user!!.id != post.userId) throw UserMisMatchException
if (user!!.id != post.user.id) throw UserMisMatchException

postRepository.deleteById(post.id)
}
Expand Down

0 comments on commit 5ccbbdc

Please sign in to comment.