Skip to content

Commit

Permalink
fix: 그룹원 수 조회 처리 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Sep 4, 2024
1 parent 43cfcde commit 3e574d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class GroupFacade(
false -> {
val succeedGroup = group.apply {
this.ownerUid = groupUser.uid
this.userCount -= 1
}
groupService.saveSync(succeedGroup)
}
Expand Down Expand Up @@ -210,10 +211,13 @@ class GroupFacade(
val groupUser = groupUserService.findByIdOrNull(groupUserId)
?: throw NotFoundException(ErrorCode.NOT_FOUND_USER_ERROR)

groupService.findByIdAndOwnerUid(groupUser.groupId, user.uid)
val group = groupService.findByIdAndOwnerUid(groupUser.groupId, user.uid)
?: throw NotFoundException(ErrorCode.NOT_FOUND_USER_ERROR)

groupUserService.deleteSync(groupUserId)
txTemplates.writer.executesOrNull {
groupUserService.deleteSync(groupUserId)
groupService.saveSync(group.apply { this.userCount -= 1 })
}
}

suspend fun checkGroupRegisterRequest(user: AuthUser, request: CheckGroupRegisterRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class GroupUserService(
}
}

@Transactional
fun deleteSync(groupUserId: Long) {
groupUserRepository.deleteById(groupUserId)
}
Expand Down

0 comments on commit 3e574d8

Please sign in to comment.