Skip to content

Commit

Permalink
fix: 워크스페이스 조인 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Dltmd202 committed Aug 22, 2024
1 parent 438ac58 commit f829ac2
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 @@ -52,6 +52,7 @@ class WorkspaceFacadeService(
}

val chatRoom: ChatRoom = chatRoomService.save(workspace.createDefaultChatRoom())
workspaceService.save(workspace)
chatRoomUserService.save(chatRoom.addUser(leader))

return WorkspaceDto.of(workspace)
Expand Down Expand Up @@ -138,7 +139,6 @@ class WorkspaceFacadeService(
val workspaceUser = workspaceUserService.getWorkspaceUser(workspace, user)
if (workspaceUser.isActivated()) throw BusinessException(StatusCode.ALREADY_JOINED_WORKSPACE)

// TODO 트랜잭션 종료시점에 이벤트 publish
notificationEventService.publishNotificationEvent(WorkspaceJoined.of(workspace, user))
workspaceUserService.save(workspaceUser.activate())

Expand All @@ -161,7 +161,6 @@ class WorkspaceFacadeService(
val workspaceUser = workspaceUserService.getWorkspaceUser(workspace, user)
if (workspaceUser.isActivated()) throw BusinessException(StatusCode.ALREADY_JOINED_WORKSPACE)

// TODO 트랜잭션 종료시점에 이벤트 publish
notificationEventService.publishNotificationEvent(WorkspaceJoined.of(workspace, user))
workspaceUserService.save(workspaceUser.activate())

Expand All @@ -185,7 +184,6 @@ class WorkspaceFacadeService(
val workspaceUser = workspaceUserService.getWorkspaceUser(workspace, user)
if (workspaceUser.isActivated()) throw BusinessException(StatusCode.ALREADY_JOINED_WORKSPACE)

// TODO 트랜잭션 종료시점에 이벤트 publish
notificationEventService.publishNotificationEvent(WorkspaceJoined.of(workspace, user))
workspaceUserService.save(workspaceUser.activate())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface WorkspaceRepository : JpaRepository<WorkspaceEntity, Long> {
@Modifying
@Query(
"update Workspace w " +
"set w.belongingNumber = w.belongingNumber " +
"set w.belongingNumber = w.belongingNumber + 1 " +
"where w.id = :workspaceId and w.belongingNumber < :limit",
)
fun updateBelongingWithLimit(
Expand Down

0 comments on commit f829ac2

Please sign in to comment.