Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: error throwing when testing hook with view form

DarkPhoenix27046cbf32a6a4e3
diff --git a/packages/nocodb/src/services/hooks.service.ts b/packages/nocodb/src/services/hooks.service.ts
index 5d7edb686a..c2b41a2dab 100644
--- a/packages/nocodb/src/services/hooks.service.ts
+++ b/packages/nocodb/src/services/hooks.service.ts
@@ -275,11 +275,19 @@ export class HooksService {
payload: { data, user },
} = param.hookTest;
+ let view = null;
+
+ if ((hook?.notification as any)?.trigger_form_id) {
+ view = await View.get(
+ context,
+ (hook.notification as any).trigger_form_id,
+ );
+ }
try {
await invokeWebhook(context, {
hook: new Hook(hook),
model: model,
- view: null,
+ view: view,
prevData: data?.previous_rows ?? null,
newData: data.rows,
user: user,