|
|
|
@ -29,6 +29,7 @@ export class HookHandlerService implements OnModuleInit, OnModuleDestroy {
|
|
|
|
|
context: NcContext, |
|
|
|
|
{ hookName, prevData, newData, user, viewId, modelId, tnPath }, |
|
|
|
|
): Promise<void> { |
|
|
|
|
try { |
|
|
|
|
const view = await View.get(context, viewId); |
|
|
|
|
const model = await Model.get(context, modelId); |
|
|
|
|
|
|
|
|
@ -136,10 +137,17 @@ export class HookHandlerService implements OnModuleInit, OnModuleDestroy {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
this.logger.error({ |
|
|
|
|
error: e, |
|
|
|
|
details: 'Error while handling hook', |
|
|
|
|
hookName, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onModuleInit(): any { |
|
|
|
|
this.unsubscribe = this.eventEmitter.on(HANDLE_WEBHOOK, async (arg) => { |
|
|
|
|
this.unsubscribe = this.eventEmitter.on(HANDLE_WEBHOOK, (arg) => { |
|
|
|
|
const { context, ...rest } = arg; |
|
|
|
|
return this.handleHooks(context, rest); |
|
|
|
|
}); |
|
|
|
|