mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +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 } },
|
||||
|
||||
@@ -15,7 +15,7 @@ export const versionDescription: INodeTypeDescription = {
|
||||
name: 'notion',
|
||||
icon: 'file:notion.svg',
|
||||
group: ['output'],
|
||||
version: 2,
|
||||
version: [2, 2.1],
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
description: 'Consume Notion API',
|
||||
defaults: {
|
||||
|
||||
Reference in New Issue
Block a user