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 }); const model = await Model.getByIdOrName({ id: param.tableId });
T.emit('evt', { evt_type: 'webhooks:tested' });
const { const {
hook, hook,
payload: { data, user }, payload: { data, user },
} = param.hookTest; } = param.hookTest;
await invokeWebhook( try {
new Hook(hook), await invokeWebhook(
model, new Hook(hook),
data, model,
user, null,
(hook as any)?.filters, null,
true data,
); user,
(hook as any)?.filters,
T.emit('evt', { evt_type: 'webhooks:tested' }); true
);
} catch (e) {
throw e;
}
return true; return true;
} }

Loading…
Cancel
Save