访问 隐藏单页

This commit is contained in:
tangly1024
2022-05-16 15:27:08 +08:00
parent 1e0ef1aee9
commit b453df8d5d

View File

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