diff --git a/plugin-hrm-form/src/utils/task.ts b/plugin-hrm-form/src/utils/task.ts index c5dda8c67a..488b5988b2 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;