|
|
@ -245,8 +245,9 @@ export async function invokeWebhook( |
|
|
|
) { |
|
|
|
) { |
|
|
|
let hookLog: HookLogType; |
|
|
|
let hookLog: HookLogType; |
|
|
|
const startTime = process.hrtime(); |
|
|
|
const startTime = process.hrtime(); |
|
|
|
|
|
|
|
let notification; |
|
|
|
try { |
|
|
|
try { |
|
|
|
const notification = |
|
|
|
notification = |
|
|
|
typeof hook.notification === 'string' |
|
|
|
typeof hook.notification === 'string' |
|
|
|
? JSON.parse(hook.notification) |
|
|
|
? JSON.parse(hook.notification) |
|
|
|
: hook.notification; |
|
|
|
: hook.notification; |
|
|
@ -299,6 +300,7 @@ export async function invokeWebhook( |
|
|
|
}); |
|
|
|
}); |
|
|
|
hookLog = { |
|
|
|
hookLog = { |
|
|
|
...hook, |
|
|
|
...hook, |
|
|
|
|
|
|
|
fk_hook_id: hook.id, |
|
|
|
type: notification.type, |
|
|
|
type: notification.type, |
|
|
|
payload: JSON.stringify(notification?.payload), |
|
|
|
payload: JSON.stringify(notification?.payload), |
|
|
|
response: JSON.stringify(res), |
|
|
|
response: JSON.stringify(res), |
|
|
@ -367,6 +369,8 @@ export async function invokeWebhook( |
|
|
|
console.log(e); |
|
|
|
console.log(e); |
|
|
|
hookLog = { |
|
|
|
hookLog = { |
|
|
|
...hook, |
|
|
|
...hook, |
|
|
|
|
|
|
|
type: notification.type, |
|
|
|
|
|
|
|
fk_hook_id: hook.id, |
|
|
|
error_code: e.error_code, |
|
|
|
error_code: e.error_code, |
|
|
|
error_message: e.message, |
|
|
|
error_message: e.message, |
|
|
|
error: JSON.stringify(e), |
|
|
|
error: JSON.stringify(e), |
|
|
|