splitbee / notion-api-worker

Notion as CMS with easy API access
MIT License
1.56k stars 197 forks source link

Fix broken pending block fetching #52

Closed JhumanJ closed 3 years ago

JhumanJ commented 3 years ago

This PR aims to address the issue raised in #51 and #41 When the page is longer than 100 blocks, it cannot be retrieved in a single call to the Notion private API. There was code to go through the "pagination" to retrieve missing blocks, but it was not working. I replaced it something simpler that does the following:

Because my code is simpler, I may have broken other things. I don't have any knowledge about the Notion private API, so if you have more experience, please review the change made.

timolins commented 3 years ago

Looking good. Thanks for this!