Handle rich_text when simplifying data on Notion Node (#2128)

This commit is contained in:
Ricardo Espinoza 2021-08-29 05:58:49 -04:00 committed by GitHub
parent 5286ccb16c
commit 31da7a7bd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -376,6 +376,9 @@ export function simplifyProperties(properties: any) {
if (['text'].includes(properties[key].type)) {
const texts = properties[key].text.map((e: { plain_text: string }) => e.plain_text || {}).join('');
results[`${key}`] = texts;
} else if (['rich_text'].includes(properties[key].type)) {
const texts = properties[key].rich_text.map((e: { plain_text: string }) => e.plain_text || {}).join('');
results[`${key}`] = texts;
} else if (['url', 'created_time', 'checkbox', 'number', 'last_edited_time', 'email', 'phone_number', 'date'].includes(properties[key].type)) {
// tslint:disable-next-line: no-any
results[`${key}`] = properties[key][type] as any;