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

Commit 03f45d5

Browse files
authored
Merge pull request #120 from ASAP-Lettering/ASAP-412
ASAP-412 트리거 제거 및 행성 순서 문제 수정
2 parents b05757c + c59a915 commit 03f45d5

3 files changed

Lines changed: 10 additions & 3 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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class SpaceQueryService(
3939
val spaces =
4040
spaceManagementPort.getAllSpaceBy(
4141
userId = DomainId(query.userId),
42-
)
42+
).sortedBy { it.index }
4343

4444
return GetSpaceUsecase.GetAllResponse(
4545
spaces =
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
drop trigger if exists update_space_is_main;

0 commit comments

Comments
 (0)