Browse Source

feat(nocodb): check hook.active before invoke webhook

pull/5317/head
Wing-Kam Wong 2 years ago
parent
commit
a05c19310d
  1. 6
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

6
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

@ -2247,8 +2247,6 @@ class BaseModelSqlv2 {
}
private async handleHooks(hookName, data, req): Promise<void> {
// const data = _data;
const view = await View.get(this.viewId);
// handle form view data submission
@ -2329,7 +2327,9 @@ class BaseModelSqlv2 {
operation,
});
for (const hook of hooks) {
invokeWebhook(hook, this.model, data, req?.user);
if (hook.active) {
invokeWebhook(hook, this.model, data, req?.user);
}
}
} catch (e) {
console.log('hooks :: error', hookName, e);

Loading…
Cancel
Save