refactor: change log line

This commit is contained in:
Anton Voylenko 2024-12-23 10:17:04 +02:00
commit 9e9d18af48

View file

@ -6,8 +6,8 @@ const { logger } = require('./logger')
const triggerWebhook = (webhookURL, sessionId, dataType, data) => {
if (enableWebHook) {
axios.post(webhookURL, { dataType, data, sessionId }, { headers: { 'x-api-key': globalApiKey } })
.then(() => logger.debug({ sessionId, dataType, data: data || '' }, `New webhook message sent to ${webhookURL}`))
.catch(error => logger.error({ sessionId, dataType, err: error, data: data || '' }, `Failed to send new webhook message to ${webhookURL}`))
.then(() => logger.debug({ sessionId, dataType, data: data || '' }, `Webhook message sent to ${webhookURL}`))
.catch(error => logger.error({ sessionId, dataType, err: error, data: data || '' }, `Failed to send webhook message to ${webhookURL}`))
}
}