Browse Source

refactor(nocodb): move emit after hook insert

pull/5317/head
Wing-Kam Wong 2 years ago
parent
commit
bc2ec28eb3
  1. 5
      packages/nocodb/src/lib/services/hook.svc.ts

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

@ -34,12 +34,13 @@ export async function hookCreate(param: {
validateHookPayload(param.hook.notification); validateHookPayload(param.hook.notification);
T.emit('evt', { evt_type: 'webhooks:created' });
// todo: type correction
const hook = await Hook.insert({ const hook = await Hook.insert({
...param.hook, ...param.hook,
fk_model_id: param.tableId, fk_model_id: param.tableId,
} as any); } as any);
T.emit('evt', { evt_type: 'webhooks:created' });
return hook; return hook;
} }

Loading…
Cancel
Save