Skip to content

Commit b6e3769

Browse files
committed
fix: page 조회할 때 node도 함께 조회
1 parent 0b22d04 commit b6e3769

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/backend/src/page/page.service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class PageService {
3737
content,
3838
emoji,
3939
workspace,
40+
node,
4041
});
4142

4243
// 페이지와 노드를 서로 연결하여 저장한다.
@@ -66,6 +67,7 @@ export class PageService {
6667
}
6768

6869
async updatePage(id: number, dto: UpdatePageDto): Promise<Page> {
70+
console.log(id, dto, 'asdfasdasd');
6971
// 갱신할 페이지를 조회한다.
7072
// 페이지를 조회한다.
7173
const page = await this.pageRepository.findOneBy({ id });
@@ -87,7 +89,10 @@ export class PageService {
8789

8890
async findPageById(id: number): Promise<Page> {
8991
// 페이지를 조회한다.
90-
const page = await this.pageRepository.findOneBy({ id });
92+
const page = await this.pageRepository.findOne({
93+
where: { id },
94+
relations: ['node'],
95+
});
9196

9297
// 페이지가 없으면 NotFound 에러
9398
if (!page) {

0 commit comments

Comments
 (0)