refactor(core): Inject dependencies into workflow services (no-changelog) (#8066)
Inject dependencies into workflow services (no-changelog) Up next: - ~~Make workflow services injectable~~ #8033 - ~~Inject dependencies into workflow services~~ (current) - Consolidate workflow controllers into one - Make workflow controller injectable - Inject dependencies into workflow controller
This commit is contained in:
@@ -6,6 +6,7 @@ import type { IExecutionResponse, IExecutionFlattedResponse } from '@/Interfaces
|
||||
import { EnterpriseWorkflowService } from '../workflows/workflow.service.ee';
|
||||
import type { WorkflowWithSharingsAndCredentials } from '@/workflows/workflows.types';
|
||||
import Container from 'typedi';
|
||||
import { WorkflowService } from '@/workflows/workflow.service';
|
||||
|
||||
export class EEExecutionsService extends ExecutionsService {
|
||||
/**
|
||||
@@ -24,14 +25,15 @@ export class EEExecutionsService extends ExecutionsService {
|
||||
if (!execution) return;
|
||||
|
||||
const relations = ['shared', 'shared.user', 'shared.role'];
|
||||
const enterpriseWorkflowService = Container.get(EnterpriseWorkflowService);
|
||||
|
||||
const workflow = (await enterpriseWorkflowService.get(
|
||||
const workflow = (await Container.get(WorkflowService).get(
|
||||
{ id: execution.workflowId },
|
||||
{ relations },
|
||||
)) as WorkflowWithSharingsAndCredentials;
|
||||
if (!workflow) return;
|
||||
|
||||
const enterpriseWorkflowService = Container.get(EnterpriseWorkflowService);
|
||||
|
||||
enterpriseWorkflowService.addOwnerAndSharings(workflow);
|
||||
await enterpriseWorkflowService.addCredentialsToWorkflow(workflow, req.user);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user