fix: type issue in notion integration (#5385)

This commit is contained in:
Dhruwang Jariwala
2025-04-16 09:45:27 +05:30
committed by GitHub
parent b685032b34
commit cdf526e130
2 changed files with 15 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ export const TYPE_MAPPING = {
[TSurveyQuestionTypeEnum.Address]: ["rich_text"],
[TSurveyQuestionTypeEnum.Matrix]: ["rich_text"],
[TSurveyQuestionTypeEnum.Cal]: ["checkbox"],
[TSurveyQuestionTypeEnum.ContactInfo]: ["rich_text"],
[TSurveyQuestionTypeEnum.Ranking]: ["rich_text"],
};
export const UNSUPPORTED_TYPES_BY_NOTION = [

View File

@@ -392,6 +392,19 @@ const getValue = (colType: string, value: string | string[] | Date | number | Re
},
];
}
if (Array.isArray(value)) {
const content = value.join("\n");
return [
{
text: {
content:
content.length > NOTION_RICH_TEXT_LIMIT
? truncateText(content, NOTION_RICH_TEXT_LIMIT)
: content,
},
},
];
}
return [
{
text: {