Browse Source

fix(nocodb): throw errors for invokeWebhook

pull/5349/head
Wing-Kam Wong 2 years ago
parent
commit
4bc4d11ab5
  1. 26
      packages/nocodb/src/lib/services/hook.svc.ts

26
packages/nocodb/src/lib/services/hook.svc.ts

@ -81,20 +81,26 @@ export async function hookTest(param: {
const model = await Model.getByIdOrName({ id: param.tableId });
T.emit('evt', { evt_type: 'webhooks:tested' });
const {
hook,
payload: { data, user },
} = param.hookTest;
await invokeWebhook(
new Hook(hook),
model,
data,
user,
(hook as any)?.filters,
true
);
T.emit('evt', { evt_type: 'webhooks:tested' });
try {
await invokeWebhook(
new Hook(hook),
model,
null,
null,
data,
user,
(hook as any)?.filters,
true
);
} catch (e) {
throw e;
}
return true;
}

Loading…
Cancel
Save