refactor(core): Decouple emailing and workflow sharing from internal hooks (no-changelog) (#10326)

This commit is contained in:
Iván Ovejero
2024-08-08 12:33:18 +02:00
committed by GitHub
parent ee8c9a5b24
commit ee03400c25
8 changed files with 47 additions and 47 deletions

View File

@@ -17,7 +17,6 @@ import { validateEntity } from '@/GenericHelpers';
import { ExternalHooks } from '@/ExternalHooks';
import { WorkflowService } from './workflow.service';
import { License } from '@/License';
import { InternalHooks } from '@/InternalHooks';
import * as utils from '@/utils';
import { listQueryMiddleware } from '@/middlewares';
import { TagService } from '@/services/tag.service';
@@ -49,7 +48,6 @@ import { GlobalConfig } from '@n8n/config';
export class WorkflowsController {
constructor(
private readonly logger: Logger,
private readonly internalHooks: InternalHooks,
private readonly externalHooks: ExternalHooks,
private readonly tagRepository: TagRepository,
private readonly enterpriseWorkflowService: EnterpriseWorkflowService,
@@ -459,7 +457,11 @@ export class WorkflowsController {
newShareeIds = toShare;
});
this.internalHooks.onWorkflowSharingUpdate(workflowId, req.user.id, shareWithIds);
this.eventService.emit('workflow-sharing-updated', {
workflowId,
userIdSharer: req.user.id,
userIdList: shareWithIds,
});
const projectsRelations = await this.projectRelationRepository.findBy({
projectId: In(newShareeIds),