Merge branch 'main' into fix/chore-fix

This commit is contained in:
Yeuoly
2024-12-09 16:08:19 +08:00
31 changed files with 332 additions and 151 deletions

View File

@ -253,6 +253,8 @@ class NotionOAuth(OAuthDataSource):
}
response = requests.get(url=f"{self._NOTION_BLOCK_SEARCH}/{block_id}", headers=headers)
response_json = response.json()
if response.status_code != 200:
raise ValueError(f"Error fetching block parent page ID: {response_json.message}")
parent = response_json["parent"]
parent_type = parent["type"]
if parent_type == "block_id":