Skip to content

Commit abe6f52

Browse files
committed
fix: page id로 노드를 갱신하던 이슈 해결
1 parent 9e9212f commit abe6f52

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

apps/backend/src/yjs/yjs.service.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,20 @@ export class YjsService
185185
if (node.type !== 'note') {
186186
continue;
187187
}
188-
const { title, id } = node.data; // TODO: 이모지 추가
188+
189+
// node.data는 페이지에 대한 정보
190+
const { title, id } = node.data;
189191
const { x, y } = node.position;
190192
const isHolding = node.isHolding;
193+
this.logger.log('log', node);
191194
if (!isHolding) {
192-
await this.nodeService.updateNode(id, { title, x, y });
195+
// TODO : node의 경우 key 값을 page id가 아닌 node id로 변경
196+
const findPage = await this.pageService.findPageById(id);
197+
await this.nodeService.updateNode(findPage.node.id, {
198+
title,
199+
x,
200+
y,
201+
});
193202
}
194203
}
195204
}

0 commit comments

Comments
 (0)