Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions components/notion/actions/retrieve-block/retrieve-block.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "notion-retrieve-block",
name: "Retrieve Page Content",
description: "Get page content as block objects or markdown. Blocks can be text, lists, media, a page, among others. [See the documentation](https://developers.notion.com/reference/retrieve-a-block)",
version: "0.2.0",
version: "0.2.1",
type: "action",
props: {
notion,
Expand Down Expand Up @@ -42,14 +42,15 @@ export default {
const subpagesOnly = retrieveChildren === "Sub-Pages Only";

const block = await this.notion.retrieveBlock(this.blockId);
if ([
const shouldRetrieveChildren = [
true,
"All Children",
"Sub-Pages Only",
].includes(retrieveChildren)) {
].includes(retrieveChildren);
if (shouldRetrieveChildren) {
block.children = await this.notion.retrieveBlockChildren(block, subpagesOnly);
}
$.export("$summary", `Successfully retrieved block${retrieveChildren
$.export("$summary", `Successfully retrieved block${shouldRetrieveChildren
? ` with ${block.children.length ?? 0} ${subpagesOnly
? "sub-pages"
: "children"}`
Expand Down
2 changes: 1 addition & 1 deletion components/notion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/notion",
"version": "0.6.0",
"version": "0.6.1",
"description": "Pipedream Notion Components",
"main": "notion.app.mjs",
"keywords": [
Expand Down
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading