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) {