mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
fix(Notion Node): Handle empty values correctly for Notion selects + multi selects (#7383)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
parent
8187be1b7d
commit
fbcd1d40ed
|
@ -320,6 +320,10 @@ function getDateFormat(includeTime: boolean) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isEmpty(value: unknown): boolean {
|
||||||
|
return value === undefined || value === null || value === '';
|
||||||
|
}
|
||||||
|
|
||||||
function getPropertyKeyValue(
|
function getPropertyKeyValue(
|
||||||
this: IExecuteFunctions,
|
this: IExecuteFunctions,
|
||||||
value: any,
|
value: any,
|
||||||
|
@ -368,7 +372,16 @@ function getPropertyKeyValue(
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'multi_select':
|
case 'multi_select':
|
||||||
|
if (isEmpty(value.multiSelectValue)) {
|
||||||
|
result = {
|
||||||
|
type: 'multi_select',
|
||||||
|
multi_select: [],
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
const multiSelectValue = value.multiSelectValue;
|
const multiSelectValue = value.multiSelectValue;
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
type: 'multi_select',
|
type: 'multi_select',
|
||||||
multi_select: (Array.isArray(multiSelectValue)
|
multi_select: (Array.isArray(multiSelectValue)
|
||||||
|
@ -403,6 +416,14 @@ function getPropertyKeyValue(
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'select':
|
case 'select':
|
||||||
|
if (isEmpty(value.selectValue)) {
|
||||||
|
result = {
|
||||||
|
type: 'select',
|
||||||
|
select: null,
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
select: version === 1 ? { id: value.selectValue } : { name: value.selectValue },
|
select: version === 1 ? { id: value.selectValue } : { name: value.selectValue },
|
||||||
|
|
Loading…
Reference in a new issue