gatsby-source-notion-churnotion 1.0.79 → 1.0.81

Sign up to get free protection for your applications and to get access to all the features.
@@ -59,7 +59,7 @@ const getBooks = async ({ bookDatabaseId, reporter, getCache, createNode, create
59
59
  update_date: page.last_edited_time,
60
60
  url: `${constants_1.COMMON_URI}/${constants_1.BOOK_URI}/${slug}`,
61
61
  book_category: book_category,
62
- book_image: bookImageNode,
62
+ book_image: bookImageNode.id,
63
63
  };
64
64
  reporter.info(`[DEBUG] Book ${bookNode.book_name} has book_category: ${bookNode.book_category}`);
65
65
  createNode(bookNode);
@@ -139,11 +139,13 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
139
139
  });
140
140
  }
141
141
  const bookId = page.properties?.book?.relation?.[0]?.id || null;
142
+ const bookNodeId = createNodeId(`${bookId}-book`);
143
+ const bookNode = getNode(bookNodeId);
142
144
  const [imageNode, tableOfContents, updatedBlocks, rawText] = await (0, processor_1.processor)(pageData.results, actions, getCache, createNodeId, reporter, cache);
143
145
  const postNode = {
144
146
  id: nodeId,
145
147
  category: parentCategoryId,
146
- book: getNode(`${bookId}-book`),
148
+ book: bookNode.id,
147
149
  book_index: page.properties?.bookIndex?.number || 0,
148
150
  title: title,
149
151
  content: updatedBlocks,
@@ -170,9 +172,6 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
170
172
  rawText,
171
173
  };
172
174
  await createNode(postNode);
173
- // book과 post 부모-자식 관계 설정
174
- const bookNodeId = createNodeId(`${bookId}-book`);
175
- const bookNode = getNode(bookNodeId);
176
175
  if (bookNode) {
177
176
  createParentChildLink({
178
177
  parent: bookNode,
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.79",
4
+ "version": "1.0.81",
5
5
  "skipLibCheck": true,
6
6
  "license": "0BSD",
7
7
  "main": "./dist/gatsby-node.js",