Skip to content

Commit

Permalink
fix: like patch api
Browse files Browse the repository at this point in the history
  • Loading branch information
dongchandev committed Apr 17, 2024
1 parent d6eae1b commit 42967ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController
class LikeController(
private val likeService: LikeService
) {
@PatchMapping("/{id}")
@PatchMapping("{id}")
fun patch(
@PathVariable("id") id: Long
): Response {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AuthServiceImpl(
issueJwtToken.reissueToken(reissueTokenReq.refreshToken)

override fun test(email: String): Token {
println("")
val member:Member? = memberJpaRepository.findByEmail(email)
return issueJwtToken.issueToken(email, member!!.role)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ class LikeService(
val isExist:Boolean = queryLikeRepository
.existsByCommunityIdAndMemberId(communityId,member.id!!)
if(isExist){
likeJpaRepository.delete(
queryLikeRepository.findByCommunityIdAndMemberId(communityId,member.id)
)
}else{
likeJpaRepository.save(
Like(communityId, member.id)
)
}else{
likeJpaRepository.delete(
queryLikeRepository
.findByCommunityIdAndMemberId(communityId,member.id)
)
}
}

Expand Down

0 comments on commit 42967ed

Please sign in to comment.