mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Notion (Beta) Node): Fix create database page with multiple relation ids not working (#5260)
🐛 fix
This commit is contained in:
@@ -27,7 +27,6 @@ import moment from 'moment-timezone';
|
|||||||
import { validate as uuidValidate } from 'uuid';
|
import { validate as uuidValidate } from 'uuid';
|
||||||
|
|
||||||
function uuidValidateWithoutDashes(this: IExecuteFunctions, value: string) {
|
function uuidValidateWithoutDashes(this: IExecuteFunctions, value: string) {
|
||||||
if (!value || typeof value !== 'string') return false;
|
|
||||||
if (uuidValidate(value)) return true;
|
if (uuidValidate(value)) return true;
|
||||||
if (value.length == 32) {
|
if (value.length == 32) {
|
||||||
//prettier-ignore
|
//prettier-ignore
|
||||||
@@ -313,12 +312,16 @@ function getPropertyKeyValue(
|
|||||||
result = {
|
result = {
|
||||||
type: 'relation',
|
type: 'relation',
|
||||||
relation: value.relationValue
|
relation: value.relationValue
|
||||||
.filter((rv: string) => {
|
.filter((relation: any) => {
|
||||||
return uuidValidateWithoutDashes.call(this, rv);
|
return relation && typeof relation === 'string';
|
||||||
})
|
})
|
||||||
.reduce((acc: [], cur: any) => {
|
.reduce((acc: [], cur: any) => {
|
||||||
return acc.concat(cur.split(',').map((relation: string) => ({ id: relation.trim() })));
|
return acc.concat(cur.split(',').map((relation: string) => relation.trim()));
|
||||||
}, []),
|
}, [])
|
||||||
|
.filter((relation: string) => {
|
||||||
|
return uuidValidateWithoutDashes.call(this, relation);
|
||||||
|
})
|
||||||
|
.map((relation: string) => ({ id: relation })),
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'multi_select':
|
case 'multi_select':
|
||||||
|
|||||||
Reference in New Issue
Block a user