Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhand committed Oct 18, 2024
1 parent 6aa74be commit 14d0ee5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions functions/webhooks/modica/FlexToModica.protected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 & {
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 14d0ee5

Please sign in to comment.