gatsby-source-notion-churnotion 1.0.10 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ const getBooks = async ({ bookDatabaseId, reporter, createNode, createNodeId, })
24
24
  parent: null,
25
25
  children: [],
26
26
  internal: {
27
- type: constants_1.NODE_TYPE.Category,
27
+ type: constants_1.NODE_TYPE.Book,
28
28
  contentDigest: crypto_1.default
29
29
  .createHash(`md5`)
30
30
  .update(JSON.stringify(page))
@@ -145,12 +145,14 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
145
145
  };
146
146
  await createNode(postNode);
147
147
  // book과 post 부모-자식 관계 설정
148
- const bookNode = getNode(bookId);
148
+ const bookNodeId = createNodeId(`${bookId}-book`);
149
+ const bookNode = getNode(bookNodeId);
149
150
  if (bookNode) {
150
151
  createParentChildLink({
151
152
  parent: bookNode,
152
153
  child: postNode,
153
154
  });
155
+ reporter.info(`[SUCCESS] Linked book: ${bookNode.book_name} -> page: ${postNode.title}`);
154
156
  }
155
157
  // tag와 post 부모-자식 관계 설정
156
158
  tagIds.forEach((tagId) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gatsby-source-notion-churnotion",
3
3
  "description": "Gatsby plugin that can connect with One Notion Database RECURSIVELY using official API",
4
- "version": "1.0.10",
4
+ "version": "1.0.12",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
7
  "main": "./dist/gatsby-node.js",