mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Notion Trigger (Beta) Node): Fix Notion trigger polling strategy
This commit is contained in:
@@ -219,12 +219,11 @@ function getTexts(
|
||||
annotations: text.annotationUi,
|
||||
});
|
||||
} else {
|
||||
//@ts-ignore
|
||||
results.push({
|
||||
type: 'mention',
|
||||
mention: {
|
||||
type: text.mentionType,
|
||||
//@ts-ignore
|
||||
//@ts-expect-error any
|
||||
[text.mentionType]: { id: text[text.mentionType] as string },
|
||||
},
|
||||
annotations: text.annotationUi,
|
||||
@@ -252,9 +251,8 @@ export function formatBlocks(blocks: IDataObject[]) {
|
||||
[block.type as string]: {
|
||||
...(block.type === 'to_do' ? { checked: block.checked } : {}),
|
||||
// prettier-ignore
|
||||
//@ts-expect-error
|
||||
// tslint:disable-next-line: no-any
|
||||
text: (block.richText === false) ? formatText(block.textContent).text : getTexts(block.text.text as any || []),
|
||||
text: (block.richText === false) ? formatText(block.textContent as string).text : getTexts((block.text as IDataObject).text as any || []),
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -266,7 +264,7 @@ function getPropertyKeyValue(value: any, type: string, timezone: string, version
|
||||
// tslint:disable-next-line: no-any
|
||||
const ignoreIfEmpty = <T>(v: T, cb: (v: T) => any) =>
|
||||
!v && value.ignoreIfEmpty ? undefined : cb(v);
|
||||
let result = {};
|
||||
let result: IDataObject = {};
|
||||
|
||||
switch (type) {
|
||||
case 'rich_text':
|
||||
@@ -362,7 +360,6 @@ function getPropertyKeyValue(value: any, type: string, timezone: string, version
|
||||
|
||||
//if the date was left empty, set it to null so it resets the value in notion
|
||||
if (value.date === '' || (value.dateStart === '' && value.dateEnd === '')) {
|
||||
//@ts-ignore
|
||||
result.date = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user