Skip to content

Commit 5a5b465

Browse files
feat: add more logging to getSiteMaps
1 parent 2743142 commit 5a5b465

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/get-all-pages.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pMemoize from 'p-memoize'
2-
import { getAllPagesInSpace } from 'notion-utils'
2+
import { getAllPagesInSpace, uuidToId } from 'notion-utils'
33

44
import * as types from './types'
55
import { includeNotionIdInUrls } from './config'
@@ -16,10 +16,15 @@ export async function getAllPagesImpl(
1616
rootNotionPageId: string,
1717
rootNotionSpaceId: string
1818
): Promise<Partial<types.SiteMap>> {
19+
const getPage = async (pageId: string, ...args) => {
20+
console.log('\nnotion getPage', uuidToId(pageId))
21+
return notion.getPage(pageId, ...args)
22+
}
23+
1924
const pageMap = await getAllPagesInSpace(
2025
rootNotionPageId,
2126
rootNotionSpaceId,
22-
notion.getPage.bind(notion)
27+
getPage
2328
)
2429

2530
const canonicalPageMap = Object.keys(pageMap).reduce(

0 commit comments

Comments
 (0)