mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Decouple event bus from internal hooks (no-changelog) (#9724)
This commit is contained in:
@@ -41,6 +41,7 @@ import { In, type FindOptionsRelations } from '@n8n/typeorm';
|
||||
import type { Project } from '@/databases/entities/Project';
|
||||
import { ProjectRelationRepository } from '@/databases/repositories/projectRelation.repository';
|
||||
import { z } from 'zod';
|
||||
import { EventRelay } from '@/eventbus/event-relay.service';
|
||||
|
||||
@RestController('/workflows')
|
||||
export class WorkflowsController {
|
||||
@@ -64,6 +65,7 @@ export class WorkflowsController {
|
||||
private readonly projectRepository: ProjectRepository,
|
||||
private readonly projectService: ProjectService,
|
||||
private readonly projectRelationRepository: ProjectRelationRepository,
|
||||
private readonly eventRelay: EventRelay,
|
||||
) {}
|
||||
|
||||
@Post('/')
|
||||
@@ -175,6 +177,7 @@ export class WorkflowsController {
|
||||
|
||||
await this.externalHooks.run('workflow.afterCreate', [savedWorkflow]);
|
||||
void this.internalHooks.onWorkflowCreated(req.user, newWorkflow, project!, false);
|
||||
this.eventRelay.emit('workflow-created', { user: req.user, workflow: newWorkflow });
|
||||
|
||||
const scopes = await this.workflowService.getWorkflowScopes(req.user, savedWorkflow.id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user