From 4797dd83f449712e99fa5b6ae316ff6a9af1f03a Mon Sep 17 00:00:00 2001 From: hyonun321 Date: Thu, 28 Nov 2024 17:01:28 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20delete=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=EB=A5=BC=20=EB=B3=B4=EB=82=BC=EB=95=8C=20pag?= =?UTF-8?q?eTitle=EB=8F=84=20=EB=B3=B4=EB=82=B4=EA=B2=8C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- @noctaCrdt/Interfaces.ts | 1 + server/src/crdt/crdt.gateway.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/@noctaCrdt/Interfaces.ts b/@noctaCrdt/Interfaces.ts index b265c3f0..56c55f5e 100644 --- a/@noctaCrdt/Interfaces.ts +++ b/@noctaCrdt/Interfaces.ts @@ -80,6 +80,7 @@ export interface RemotePageDeleteOperation { type: "pageDelete"; clientId: number; workspaceId: string; + pageTitle: string; pageId: string; } diff --git a/server/src/crdt/crdt.gateway.ts b/server/src/crdt/crdt.gateway.ts index e1488724..7fc774cd 100644 --- a/server/src/crdt/crdt.gateway.ts +++ b/server/src/crdt/crdt.gateway.ts @@ -280,13 +280,14 @@ export class CrdtGateway implements OnGatewayInit, OnGatewayConnection, OnGatewa if (pageIndex === -1) { throw new Error(`Page with id ${data.pageId} not found`); } - // pageList에서 페이지 제거 + const pageTitle = (await this.workSpaceService.getPage(userId, data.pageId)).title; currentWorkspace.pageList.splice(pageIndex, 1); const operation = { type: "pageDelete", workspaceId: data.workspaceId, pageId: data.pageId, + pageTitle, clientId: data.clientId, } as RemotePageDeleteOperation; client.emit("delete/page", operation);