Browse Source

fix(nocodb): add missing type & fk_hook_id in webhookHelper.ts

pull/5349/head
Wing-Kam Wong 2 years ago
parent
commit
d3061a9231
  1. 6
      packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts

6
packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts

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

Loading…
Cancel
Save