mirror of
https://github.com/zhigang1992/notion-api-worker.git
synced 2026-01-12 17:32:42 +08:00
Revert "Fix broken pending block fetching"
This reverts commit bf8c9c50b8.
This commit is contained in:
@@ -16,11 +16,15 @@ export async function pageRoute(req: HandlerRequest) {
|
||||
let allBlockKeys;
|
||||
|
||||
while (true) {
|
||||
allBlockKeys = Object.keys(allBlocks);
|
||||
|
||||
allBlockKeys = allBlocks[pageId!].value.content
|
||||
const pendingBlocks = allBlockKeys.flatMap((blockId) => {
|
||||
const block = allBlocks[blockId];
|
||||
const content = block.value && block.value.content;
|
||||
|
||||
const pendingBlocks = allBlockKeys!.filter((blockId) => {
|
||||
return !allBlocks.hasOwnProperty(blockId)
|
||||
return content && block.value.type !== "page"
|
||||
? content.filter((id: string) => !allBlocks[id])
|
||||
: [];
|
||||
});
|
||||
|
||||
if (!pendingBlocks.length) {
|
||||
|
||||
Reference in New Issue
Block a user