🐛 Fix issue listing databases without name on Notion Node (#2197)

This commit is contained in:
Ricardo Espinoza 2021-09-15 04:13:11 -04:00 committed by GitHub
parent 4db451d9d9
commit fd064b7816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,7 +100,7 @@ export class NotionTrigger implements INodeType {
const { results: databases } = await notionApiRequest.call(this, 'POST', `/search`, { page_size: 100, filter: { property: 'object', value: 'database' } }); const { results: databases } = await notionApiRequest.call(this, 'POST', `/search`, { page_size: 100, filter: { property: 'object', value: 'database' } });
for (const database of databases) { for (const database of databases) {
returnData.push({ returnData.push({
name: database.title[0].plain_text, name: database.title[0]?.plain_text || database.id,
value: database.id, value: database.id,
}); });
} }