mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 23:16:51 +00:00
完善获取文章列表
This commit is contained in:
@@ -211,13 +211,18 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) {
|
||||
}
|
||||
|
||||
const collection = Object.values(pageRecordMap.collection)[0]?.value
|
||||
const collectionId = rawMetadata?.collection_id
|
||||
const collectionQuery = pageRecordMap.collection_query
|
||||
const collectionView = pageRecordMap.collection_view
|
||||
const schema = collection?.schema
|
||||
const tagOptions = getTagOptions(schema)
|
||||
const categoryOptions = getCategoryOptions(schema)
|
||||
|
||||
const viewIds = rawMetadata?.view_ids
|
||||
const data = []
|
||||
const pageIds = getAllPageIds(collectionQuery)
|
||||
const pageIds = getAllPageIds(collectionQuery, collectionId, collectionView, viewIds)
|
||||
if (pageIds?.length === 0) {
|
||||
console.error('获取到的文章列表为空,请检查notion模板', collectionQuery, collection, pageRecordMap)
|
||||
}
|
||||
for (let i = 0; i < pageIds.length; i++) {
|
||||
const id = pageIds[i]
|
||||
const properties = (await getPageProperties(id, block, schema)) || null
|
||||
@@ -243,6 +248,9 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) {
|
||||
return {
|
||||
collection,
|
||||
collectionQuery,
|
||||
collectionId,
|
||||
collectionView,
|
||||
viewIds,
|
||||
block,
|
||||
schema,
|
||||
tagOptions,
|
||||
|
||||
Reference in New Issue
Block a user