UNPKG

@udus/notion-renderer

Version:
19 lines (18 loc) 492 B
import { Client, isFullPage } from "@notionhq/client"; import { retrievePage } from "../../pages/retrieve.js"; export const convertChildPageResponseToBlock = async (block, client) => { const { ok, data } = await retrievePage(client, { page_id: block.id }); if (!ok) { return block; } if (!isFullPage(data)) { return block; } return { ...block, child_page: { ...block.child_page, page: data, }, }; };