From b453df8d5dd689b33e2f2d080a70fd46c16dfe75 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Mon, 16 May 2022 15:27:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BF=E9=97=AE=20=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=8D=95=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getAllPosts.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/notion/getAllPosts.js b/lib/notion/getAllPosts.js index c853ffdd..c7d14684 100644 --- a/lib/notion/getAllPosts.js +++ b/lib/notion/getAllPosts.js @@ -34,7 +34,12 @@ export async function getAllPosts({ notionPageData, from, pageType }) { // remove all the the items doesn't meet requirements const posts = data.filter(post => { - return post.title && post?.status?.[0] === 'Published' && pageType.indexOf(post?.type?.[0]) > -1 + if (pageType === 'Post') { + return post.title && post?.status?.[0] === 'Published' && pageType.indexOf(post?.type?.[0]) > -1 + } else { + // ้š่—ๅ•้กต + return post.title && (post?.status?.[0] === 'Published' || post?.status?.[0] === 'Invisible') && pageType.indexOf(post?.type?.[0]) > -1 + } }) if (!posts || posts.length === 0) {