mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
feat(Notion Node): Option to simplify output in getChildBlocks operation (#7791)
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Marcus <marcus@n8n.io>
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
notionApiRequest,
|
||||
notionApiRequestAllItems,
|
||||
notionApiRequestGetBlockChildrens,
|
||||
simplifyBlocksOutput,
|
||||
simplifyObjects,
|
||||
validateJSON,
|
||||
} from '../GenericFunctions';
|
||||
@@ -312,6 +313,16 @@ export class NotionV2 implements INodeType {
|
||||
..._data,
|
||||
}));
|
||||
|
||||
const nodeVersion = this.getNode().typeVersion;
|
||||
|
||||
if (nodeVersion > 2) {
|
||||
const simplifyOutput = this.getNodeParameter('simplifyOutput', i) as boolean;
|
||||
|
||||
if (simplifyOutput) {
|
||||
responseData = simplifyBlocksOutput(responseData, blockId);
|
||||
}
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject),
|
||||
{ itemData: { item: i } },
|
||||
|
||||
Reference in New Issue
Block a user