From 62743e1735395e7c6b6d47e3664f3f8c9a8e978d Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 29 Apr 2022 13:26:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=8F=E5=89=8D=E7=AB=AF=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getAllPosts.js | 2 +- lib/notion/getNotionData.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/notion/getAllPosts.js b/lib/notion/getAllPosts.js index 37a6263f..47198789 100644 --- a/lib/notion/getAllPosts.js +++ b/lib/notion/getAllPosts.js @@ -23,7 +23,7 @@ export async function getAllPosts({ notionPageData, from, pageType }) { const pageBlock = notionPageData.block const schema = notionPageData.schema - const tagOptions = notionPageData.tagOptions + const tagOptions = notionPageData.tags const collectionQuery = notionPageData.collectionQuery const data = [] diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 58878982..0bf9e184 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -28,6 +28,15 @@ export async function getGlobalNotionData({ const notionPageData = await getNotionPageData({ pageId, from }) const allPosts = await getAllPosts({ notionPageData, from, pageType }) notionPageData.allPosts = allPosts + // 删除前端不需要的数据 + delete notionPageData.block + delete notionPageData.collection + delete notionPageData.collectionQuery + delete notionPageData.schema + delete notionPageData.rawMetadata + delete notionPageData.pageIds + delete notionPageData.tagOptions + delete notionPageData.categoryOptions return notionPageData }