Merge pull request #3425 from JinliG/bugfix/jinli/fix-retrieve-index

fix: 修复兼容 notion-client 索引 index 问题
This commit is contained in:
tangly1024
2025-06-05 12:42:18 +08:00
committed by GitHub

View File

@@ -7,7 +7,8 @@ export default function getAllPageIds (collectionQuery, collectionId, collection
let pageIds = []
try {
if (viewIds && viewIds.length > 0) {
const ids = collectionQuery[collectionId][viewIds[0]]?.collection_group_results?.blockIds
const groupIndex = viewIds.length > 0 ? viewIds.length - 1 : 0
const ids = collectionQuery[collectionId][viewIds[groupIndex]]?.collection_group_results?.blockIds
for (const id of ids) {
pageIds.push(id)
}