Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit c59a915

Browse files
committed
ASAP-412 삭제할 때 main 행성이 포함될때에만 main이 수정되도록 수정
1 parent d998273 commit c59a915

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Application-Module/src/main/kotlin/com/asap/application/space/service/SpaceCommandService.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ class SpaceCommandService(
4848
userId = userId,
4949
spaceId = DomainId(command.spaceId),
5050
).apply {
51+
if (isMain) {
52+
updateMainSpace(userId)
53+
}
54+
5155
delete()
5256
spaceManagementPort.deleteBy(this)
5357
}
54-
updateMainSpace(userId)
5558
reIndexingSpaceOrder(userId)
5659
}
5760

@@ -62,10 +65,13 @@ class SpaceCommandService(
6265
userId = userId,
6366
spaceIds = command.spaceIds.map { DomainId(it) },
6467
).forEach {
68+
if (it.isMain) {
69+
updateMainSpace(userId)
70+
}
6571
it.delete()
6672
spaceManagementPort.deleteBy(it)
6773
}
68-
updateMainSpace(userId)
74+
6975
reIndexingSpaceOrder(userId)
7076
}
7177

0 commit comments

Comments
 (0)