mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Move methods from WorkflowHelpers into various workflow services (no-changelog) (#8348)
This commit is contained in:
committed by
GitHub
parent
ab52aaf7e9
commit
7cdbb424e3
@@ -28,7 +28,6 @@ import history from 'connect-history-api-fallback';
|
||||
|
||||
import config from '@/config';
|
||||
import { Queue } from '@/Queue';
|
||||
import { getSharedWorkflowIds } from '@/WorkflowHelpers';
|
||||
|
||||
import { WorkflowsController } from '@/workflows/workflows.controller';
|
||||
import {
|
||||
@@ -103,6 +102,7 @@ import { RoleController } from './controllers/role.controller';
|
||||
import { BadRequestError } from './errors/response-errors/bad-request.error';
|
||||
import { NotFoundError } from './errors/response-errors/not-found.error';
|
||||
import { MultiMainSetup } from './services/orchestration/main/MultiMainSetup.ee';
|
||||
import { WorkflowSharingService } from './workflows/workflowSharing.service';
|
||||
|
||||
const exec = promisify(callbackExec);
|
||||
|
||||
@@ -436,7 +436,9 @@ export class Server extends AbstractServer {
|
||||
},
|
||||
};
|
||||
|
||||
const sharedWorkflowIds = await getSharedWorkflowIds(req.user);
|
||||
const sharedWorkflowIds = await Container.get(
|
||||
WorkflowSharingService,
|
||||
).getSharedWorkflowIds(req.user);
|
||||
|
||||
if (!sharedWorkflowIds.length) return [];
|
||||
|
||||
@@ -484,7 +486,9 @@ export class Server extends AbstractServer {
|
||||
|
||||
const filter = req.query.filter ? jsonParse<any>(req.query.filter) : {};
|
||||
|
||||
const sharedWorkflowIds = await getSharedWorkflowIds(req.user);
|
||||
const sharedWorkflowIds = await Container.get(
|
||||
WorkflowSharingService,
|
||||
).getSharedWorkflowIds(req.user);
|
||||
|
||||
for (const data of executingWorkflows) {
|
||||
if (
|
||||
@@ -517,7 +521,9 @@ export class Server extends AbstractServer {
|
||||
ResponseHelper.send(async (req: ExecutionRequest.Stop): Promise<IExecutionsStopData> => {
|
||||
const { id: executionId } = req.params;
|
||||
|
||||
const sharedWorkflowIds = await getSharedWorkflowIds(req.user);
|
||||
const sharedWorkflowIds = await Container.get(WorkflowSharingService).getSharedWorkflowIds(
|
||||
req.user,
|
||||
);
|
||||
|
||||
if (!sharedWorkflowIds.length) {
|
||||
throw new NotFoundError('Execution not found');
|
||||
|
||||
Reference in New Issue
Block a user