From bc2ec28eb31698974db5e21a6b8872f96f35991e Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 17 Mar 2023 18:55:22 +0800 Subject: [PATCH] refactor(nocodb): move emit after hook insert --- packages/nocodb/src/lib/services/hook.svc.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/lib/services/hook.svc.ts b/packages/nocodb/src/lib/services/hook.svc.ts index 2964349bd1..04d2dc5f96 100644 --- a/packages/nocodb/src/lib/services/hook.svc.ts +++ b/packages/nocodb/src/lib/services/hook.svc.ts @@ -34,12 +34,13 @@ export async function hookCreate(param: { validateHookPayload(param.hook.notification); - T.emit('evt', { evt_type: 'webhooks:created' }); - // todo: type correction const hook = await Hook.insert({ ...param.hook, fk_model_id: param.tableId, } as any); + + T.emit('evt', { evt_type: 'webhooks:created' }); + return hook; }