Skip to content

Commit

Permalink
feat: 알리미 api 수정 (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
injoon2019 authored Sep 11, 2024
1 parent 10f98f9 commit 8bde002
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ data class UserAlimy(
@Enumerated(EnumType.STRING)
val alimyType: AlimyType,

val enabled: Boolean = true,
var enabled: Boolean = true,
): BaseEntity() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class UserAlimyService(
@Transactional
fun turnOnOffAlimy(userId: Long, alimyType: AlimyType, enabled: Boolean) {
userAlimyRepository.findByUserIdAndAlimyType(userId, alimyType)?.let {
userAlimyRepository.save(
UserAlimy(userId = userId, alimyType = alimyType, enabled = enabled)
)
it.enabled = enabled
} ?: run {
userAlimyRepository.save(
UserAlimy(userId = userId, alimyType = alimyType, enabled = enabled)
Expand Down

0 comments on commit 8bde002

Please sign in to comment.