import { Client } from "npm:@notionhq/client";
import type { BlockObjectRequest } from "npm:@notionhq/client/2.2.4/build/src/api-endpoints.js";
/**
* Learn more at
* https://developers.notion.com/reference/patch-block-children
*/
type Notion = {
token: string;
};
export async function main(
auth: Notion,
block_id: string,
children: object[] = [],
) {
const client = new Client({ auth: auth.token });
return await client.blocks.children.append({
block_id,
children: children as BlockObjectRequest,
});
}
Submitted by admin 463 days ago
import { Resource } from "https://deno.land/x/windmill@v1.89.0/mod.ts";
import { Client } from "npm:@notionhq/client";
import type { BlockObjectRequest } from "npm:@notionhq/client/2.2.4/build/src/api-endpoints.js";
/**
* Learn more at
* https://developers.notion.com/reference/patch-block-children
*/
export async function main(
auth: Resource<"notion">,
block_id: string,
children: object[] = [],
) {
const client = new Client({ auth: auth.token });
return await client.blocks.children.append({
block_id,
children: children as BlockObjectRequest,
});
}
Submitted by adam186 570 days ago