mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(Notion (Beta) Node): Fix create database page fails if relation param is empty/undefined (#5182)
* 🐛 fix create database page fails if relation param is empty/undefined * ⚡ uuid validation * ⚡ uuid error handling Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
notionApiRequest,
|
||||
notionApiRequestAllItems,
|
||||
simplifyObjects,
|
||||
SortData,
|
||||
validateJSON,
|
||||
} from '../GenericFunctions';
|
||||
|
||||
@@ -457,7 +458,7 @@ export class NotionV2 implements INodeType {
|
||||
if (propertiesValues.length !== 0) {
|
||||
body.properties = Object.assign(
|
||||
body.properties,
|
||||
mapProperties(propertiesValues, timezone, 2) as IDataObject,
|
||||
mapProperties.call(this, propertiesValues, timezone, 2) as IDataObject,
|
||||
);
|
||||
}
|
||||
const blockValues = this.getNodeParameter('blockUi.blockValues', i, []) as IDataObject[];
|
||||
@@ -536,8 +537,7 @@ export class NotionV2 implements INodeType {
|
||||
delete body.filter;
|
||||
}
|
||||
if (sort) {
|
||||
//@ts-expect-error
|
||||
body.sorts = mapSorting(sort);
|
||||
body.sorts = mapSorting(sort as SortData[]);
|
||||
}
|
||||
if (returnAll) {
|
||||
responseData = await notionApiRequestAllItems.call(
|
||||
@@ -590,7 +590,7 @@ export class NotionV2 implements INodeType {
|
||||
properties: {},
|
||||
};
|
||||
if (properties.length !== 0) {
|
||||
body.properties = mapProperties(properties, timezone, 2) as IDataObject;
|
||||
body.properties = mapProperties.call(this, properties, timezone, 2) as IDataObject;
|
||||
}
|
||||
responseData = await notionApiRequest.call(this, 'PATCH', `/pages/${pageId}`, body);
|
||||
if (simple) {
|
||||
|
||||
Reference in New Issue
Block a user