|
|
@ -29,6 +29,7 @@ export class HookHandlerService implements OnModuleInit, OnModuleDestroy { |
|
|
|
context: NcContext, |
|
|
|
context: NcContext, |
|
|
|
{ hookName, prevData, newData, user, viewId, modelId, tnPath }, |
|
|
|
{ hookName, prevData, newData, user, viewId, modelId, tnPath }, |
|
|
|
): Promise<void> { |
|
|
|
): Promise<void> { |
|
|
|
|
|
|
|
try { |
|
|
|
const view = await View.get(context, viewId); |
|
|
|
const view = await View.get(context, viewId); |
|
|
|
const model = await Model.get(context, modelId); |
|
|
|
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 { |
|
|
|
onModuleInit(): any { |
|
|
|
this.unsubscribe = this.eventEmitter.on(HANDLE_WEBHOOK, async (arg) => { |
|
|
|
this.unsubscribe = this.eventEmitter.on(HANDLE_WEBHOOK, (arg) => { |
|
|
|
const { context, ...rest } = arg; |
|
|
|
const { context, ...rest } = arg; |
|
|
|
return this.handleHooks(context, rest); |
|
|
|
return this.handleHooks(context, rest); |
|
|
|
}); |
|
|
|
}); |
|
|
|