From d9982739c476a3566b6f7c28978b26835201c200 Mon Sep 17 00:00:00 2001 From: Sim-km Date: Sat, 8 Feb 2025 23:17:47 +0900 Subject: [PATCH 1/2] =?UTF-8?q?ASAP-412=20=ED=8A=B8=EB=A6=AC=EA=B1=B0=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20=ED=96=89=EC=84=B1=20=EC=88=9C?= =?UTF-8?q?=EC=84=9C=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/asap/application/space/service/SpaceQueryService.kt | 2 +- .../Persistence/src/main/resources/db/V1_18__drop_trigger.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Infrastructure-Module/Persistence/src/main/resources/db/V1_18__drop_trigger.sql diff --git a/Application-Module/src/main/kotlin/com/asap/application/space/service/SpaceQueryService.kt b/Application-Module/src/main/kotlin/com/asap/application/space/service/SpaceQueryService.kt index e64dc80..602a0be 100644 --- a/Application-Module/src/main/kotlin/com/asap/application/space/service/SpaceQueryService.kt +++ b/Application-Module/src/main/kotlin/com/asap/application/space/service/SpaceQueryService.kt @@ -39,7 +39,7 @@ class SpaceQueryService( val spaces = spaceManagementPort.getAllSpaceBy( userId = DomainId(query.userId), - ) + ).sortedBy { it.index } return GetSpaceUsecase.GetAllResponse( spaces = diff --git a/Infrastructure-Module/Persistence/src/main/resources/db/V1_18__drop_trigger.sql b/Infrastructure-Module/Persistence/src/main/resources/db/V1_18__drop_trigger.sql new file mode 100644 index 0000000..71b58ca --- /dev/null +++ b/Infrastructure-Module/Persistence/src/main/resources/db/V1_18__drop_trigger.sql @@ -0,0 +1 @@ +drop trigger if exists update_space_is_main; \ No newline at end of file From c59a915937c1c3f356d261c21d474b9671c46317 Mon Sep 17 00:00:00 2001 From: Sim-km Date: Sat, 8 Feb 2025 23:21:44 +0900 Subject: [PATCH 2/2] =?UTF-8?q?ASAP-412=20=EC=82=AD=EC=A0=9C=ED=95=A0=20?= =?UTF-8?q?=EB=95=8C=20main=20=ED=96=89=EC=84=B1=EC=9D=B4=20=ED=8F=AC?= =?UTF-8?q?=ED=95=A8=EB=90=A0=EB=95=8C=EC=97=90=EB=A7=8C=20main=EC=9D=B4?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/space/service/SpaceCommandService.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Application-Module/src/main/kotlin/com/asap/application/space/service/SpaceCommandService.kt b/Application-Module/src/main/kotlin/com/asap/application/space/service/SpaceCommandService.kt index 18561a9..029673c 100644 --- a/Application-Module/src/main/kotlin/com/asap/application/space/service/SpaceCommandService.kt +++ b/Application-Module/src/main/kotlin/com/asap/application/space/service/SpaceCommandService.kt @@ -48,10 +48,13 @@ class SpaceCommandService( userId = userId, spaceId = DomainId(command.spaceId), ).apply { + if (isMain) { + updateMainSpace(userId) + } + delete() spaceManagementPort.deleteBy(this) } - updateMainSpace(userId) reIndexingSpaceOrder(userId) } @@ -62,10 +65,13 @@ class SpaceCommandService( userId = userId, spaceIds = command.spaceIds.map { DomainId(it) }, ).forEach { + if (it.isMain) { + updateMainSpace(userId) + } it.delete() spaceManagementPort.deleteBy(it) } - updateMainSpace(userId) + reIndexingSpaceOrder(userId) }