From c309ac5c6d4cc152eff22fffdc97699726c7a0cb Mon Sep 17 00:00:00 2001 From: Jinli Date: Thu, 29 May 2025 14:28:42 +0800 Subject: [PATCH] fix: retrieve index --- lib/notion/getAllPageIds.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/notion/getAllPageIds.js b/lib/notion/getAllPageIds.js index 6d606d9a..48994035 100644 --- a/lib/notion/getAllPageIds.js +++ b/lib/notion/getAllPageIds.js @@ -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) }