From 79a03b80412913af4a68cc9f915f10528fab8d44 Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Thu, 18 Dec 2025 18:00:42 +0100 Subject: [PATCH] Fix ts error resolve rich text (#16688) As title --- .../components/WorkflowEditActionUpsertRecord.tsx | 2 +- .../workflow-actions/tool-executor-workflow-action.ts | 5 +---- .../twenty-shared/src/utils/rich-text-variable-resolver.ts | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx index be75b23406..7b1d749aa9 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx @@ -268,7 +268,7 @@ export const WorkflowEditActionUpsertRecord = ({ { handleFieldChange('id', recordId); }} diff --git a/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/tool-executor-workflow-action.ts b/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/tool-executor-workflow-action.ts index 6b7971ecad..c16e916753 100644 --- a/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/tool-executor-workflow-action.ts +++ b/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/tool-executor-workflow-action.ts @@ -53,10 +53,7 @@ export class ToolExecutorWorkflowAction implements WorkflowAction { if (sendEmailInput.body) { toolInput = { ...sendEmailInput, - body: resolveRichTextVariables( - sendEmailInput.body, - context, - ), + body: resolveRichTextVariables(sendEmailInput.body, context), }; } } diff --git a/packages/twenty-shared/src/utils/rich-text-variable-resolver.ts b/packages/twenty-shared/src/utils/rich-text-variable-resolver.ts index 40f80fcf9d..1223ab2ed3 100644 --- a/packages/twenty-shared/src/utils/rich-text-variable-resolver.ts +++ b/packages/twenty-shared/src/utils/rich-text-variable-resolver.ts @@ -31,9 +31,9 @@ const buildTextNodesWithLineBreaks = (text: string): string => { export const resolveRichTextVariables = ( input: string | null | undefined, context: Record, -): string | null | undefined => { +): string | undefined => { if (!isDefined(input)) { - return input; + return undefined; } return input.replace(