From 60d5c653281dbba64bf4b54ccbf7afa48fb2278a Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Mon, 13 May 2024 13:57:41 -0300 Subject: [PATCH] fix: remove all spaces from identifier (replaceAll is a thing (: ) --- plugin-hrm-form/src/utils/task.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin-hrm-form/src/utils/task.ts b/plugin-hrm-form/src/utils/task.ts index c5dda8c67..488b5988b 100644 --- a/plugin-hrm-form/src/utils/task.ts +++ b/plugin-hrm-form/src/utils/task.ts @@ -25,7 +25,7 @@ const getContactValueFromWebchat = task => { return preEngagementData.contactIdentifier; }; -const trimSpaces = (s: string) => s.replace(' ', ''); +const trimSpaces = (s: string) => s.replaceAll(' ', ''); type TransformIdentifierFunction = (c: string) => string; const channelTransformations: { [k in ChannelTypes]: TransformIdentifierFunction[] } = { @@ -40,6 +40,9 @@ const channelTransformations: { [k in ChannelTypes]: TransformIdentifierFunction web: [], }; +/** + * IMPORTANT: if any logic is changed here, replicate it in serverless/functions/getProfileFlagsForIdentifier.protected.ts + */ export const getNumberFromTask = (task: CustomITask) => { if (!isTwilioTask(task)) return null;