From 175b4dfa1e9ccb252427155af635516736e118fd Mon Sep 17 00:00:00 2001 From: Stephen Hand Date: Thu, 23 May 2024 16:26:27 +0100 Subject: [PATCH] Fix map removal event hook --- .../customChannelToFlex.private.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/functions/helpers/customChannels/customChannelToFlex.private.ts b/functions/helpers/customChannels/customChannelToFlex.private.ts index 2f28c38e..ff7f0ed6 100644 --- a/functions/helpers/customChannels/customChannelToFlex.private.ts +++ b/functions/helpers/customChannels/customChannelToFlex.private.ts @@ -333,18 +333,16 @@ const createConversation = async ( }, }); - if (onConversationUpdateWebhookUrl) { - await conversationContext.webhooks.create({ - target: 'webhook', - configuration: { - method: 'POST', - url: - onConversationUpdateWebhookUrl || - `https://${context.DOMAIN_NAME}/webhooks/FlexChannelUpdate`, - filters: ['onConversationStateUpdated'], - }, - }); - } + await conversationContext.webhooks.create({ + target: 'webhook', + configuration: { + method: 'POST', + url: + onConversationUpdateWebhookUrl || + `https://${context.DOMAIN_NAME}/webhooks/FlexChannelUpdate`, + filters: ['onConversationStateUpdated'], + }, + }); } catch (err) { return { conversationSid, error: err as Error }; }