gatsby-source-notion-churnotion 1.0.28 → 1.0.29
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api/getPages.js +17 -0
- package/package.json +1 -1
package/dist/api/getPages.js
CHANGED
@@ -54,8 +54,25 @@ const getPages = async ({ databaseId, reporter, getCache, actions, createNode, c
|
|
54
54
|
.digest(`hex`),
|
55
55
|
},
|
56
56
|
url: `${constants_1.COMMON_URI}/${constants_1.CATEGORY_URI}${categoryUrl}`,
|
57
|
+
books: null,
|
57
58
|
};
|
58
59
|
createNode(categoryNode);
|
60
|
+
// Find Book
|
61
|
+
const bookRelations = page.properties?.books?.relation || null;
|
62
|
+
if (bookRelations) {
|
63
|
+
bookRelations.forEach((relation) => {
|
64
|
+
const bookId = relation.id;
|
65
|
+
const bookNodeId = createNodeId(`${bookId}-book`);
|
66
|
+
const bookNode = getNode(bookNodeId);
|
67
|
+
if (bookNode) {
|
68
|
+
createParentChildLink({
|
69
|
+
parent: categoryNode,
|
70
|
+
child: bookNode,
|
71
|
+
});
|
72
|
+
reporter.info(`[SUCCESS] Linked Category-Book: ${categoryNode.category_name} -> child: ${bookNode.book_name}`);
|
73
|
+
}
|
74
|
+
});
|
75
|
+
}
|
59
76
|
if (parentCategoryId && categoryNode) {
|
60
77
|
const parentNode = getNode(parentCategoryId); // Gatsby에서 노드를 검색
|
61
78
|
if (parentNode) {
|
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.
|
4
|
+
"version": "1.0.29",
|
5
5
|
"skipLibCheck": true,
|
6
6
|
"license": "0BSD",
|
7
7
|
"main": "./dist/gatsby-node.js",
|