diff --git a/functions/helpers/customChannels/flexToCustomChannel.private.ts b/functions/helpers/customChannels/flexToCustomChannel.private.ts index a2b6a8f6..8ff50361 100644 --- a/functions/helpers/customChannels/flexToCustomChannel.private.ts +++ b/functions/helpers/customChannels/flexToCustomChannel.private.ts @@ -102,7 +102,8 @@ export const redirectConversationMessageToExternalChat = async ( const client = context.getTwilioClient(); useTestApi = JSON.parse( - (await client.conversations.v1.conversations(ConversationSid).fetch())?.attributes ?? {}, + (await client.conversations.v1.conversations.get(ConversationSid).fetch())?.attributes ?? + {}, ).useTestApi ?? useTestApi; const participants = await client.conversations.v1.conversations .get(ConversationSid) diff --git a/functions/webhooks/modica/FlexToModica.protected.ts b/functions/webhooks/modica/FlexToModica.protected.ts index dd98ccad..ff88aafe 100644 --- a/functions/webhooks/modica/FlexToModica.protected.ts +++ b/functions/webhooks/modica/FlexToModica.protected.ts @@ -41,8 +41,8 @@ export type EnvVars = { MODICA_APP_NAME: string; MODICA_APP_PASSWORD: string; CHAT_SERVICE_SID: string; - MODICA_SEND_MESSAGE_URL: string; - MODICA_TEST_SEND_MESSAGE_URL: string; + MODICA_SEND_MESSAGE_URL?: string; + MODICA_TEST_SEND_MESSAGE_URL?: string; }; export type Body = WebhookEvent & { @@ -97,7 +97,7 @@ const sendMessageThroughModica = ).toString('base64'); const response = await fetch( useTestApi - ? context.MODICA_TEST_SEND_MESSAGE_URL + ? context.MODICA_TEST_SEND_MESSAGE_URL! : context.MODICA_SEND_MESSAGE_URL || DEFAULT_MODICA_SEND_MESSAGE_URL, { method: 'POST',