Skip to content

Commit

Permalink
feat: delete 페이지 정보를 보낼때 pageTitle도 보내게 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hyonun321 committed Nov 28, 2024
1 parent b73474b commit 4797dd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions @noctaCrdt/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export interface RemotePageDeleteOperation {
type: "pageDelete";
clientId: number;
workspaceId: string;
pageTitle: string;
pageId: string;
}

Expand Down
3 changes: 2 additions & 1 deletion server/src/crdt/crdt.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4797dd8

Please sign in to comment.