mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-31 15:10:11 +00:00
修复映射Notion数据库字段
This commit is contained in:
@@ -251,13 +251,21 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) {
|
||||
collectionData.push(properties)
|
||||
}
|
||||
}
|
||||
// 读取映射 配置
|
||||
console.log('当前Notion映射配置-(在blog.config.js中配置)', BLOG.NOTION_PROPERTY_NAME)
|
||||
const { type, status } = BLOG.NOTION_PROPERTY_NAME
|
||||
|
||||
const allPages = collectionData.filter(post => {
|
||||
return post.title && ['Page'].indexOf(post?.type?.[0]) > -1 && (post?.status?.[0] === 'Published' || post?.status?.[0] === 'Invisible')
|
||||
return post && post[type] &&
|
||||
['Page'].indexOf(post[type]?.[0]) > -1 &&
|
||||
(post[status]?.[0] === 'Published' || post[status]?.[0] === 'Invisible')
|
||||
})
|
||||
const allPosts = collectionData.filter(post => {
|
||||
return post.title && ['Post'].indexOf(post?.type?.[0]) > -1 && post?.status?.[0] === 'Published'
|
||||
return post && post[status] &&
|
||||
['Post'].indexOf(post[type]?.[0]) > -1 &&
|
||||
post[status]?.[0] === 'Published'
|
||||
})
|
||||
console.error('全部单页', allPages.length, '全部博客', allPosts.length)
|
||||
|
||||
// Sort by date
|
||||
if (BLOG.POSTS_SORT_BY === 'date') {
|
||||
|
||||
Reference in New Issue
Block a user