mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
Done
This commit is contained in:
@@ -427,7 +427,9 @@ class App {
|
||||
const newWorkflowData = req.body;
|
||||
const id = req.params.id;
|
||||
|
||||
if (this.activeWorkflowRunner.isActive(id)) {
|
||||
const isActive = await this.activeWorkflowRunner.isActive(id);
|
||||
|
||||
if (isActive) {
|
||||
// When workflow gets saved always remove it as the triggers could have been
|
||||
// changed and so the changes would not take effect
|
||||
await this.activeWorkflowRunner.remove(id);
|
||||
@@ -492,7 +494,9 @@ class App {
|
||||
this.app.delete('/rest/workflows/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise<boolean> => {
|
||||
const id = req.params.id;
|
||||
|
||||
if (this.activeWorkflowRunner.isActive(id)) {
|
||||
const isActive = await this.activeWorkflowRunner.isActive(id);
|
||||
|
||||
if (isActive) {
|
||||
// Before deleting a workflow deactivate it
|
||||
await this.activeWorkflowRunner.remove(id);
|
||||
}
|
||||
@@ -503,6 +507,7 @@ class App {
|
||||
}));
|
||||
|
||||
|
||||
|
||||
this.app.post('/rest/workflows/run', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise<IExecutionPushResponse> => {
|
||||
const workflowData = req.body.workflowData;
|
||||
const runData: IRunData | undefined = req.body.runData;
|
||||
@@ -632,7 +637,8 @@ class App {
|
||||
|
||||
// Returns the active workflow ids
|
||||
this.app.get('/rest/active', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise<string[]> => {
|
||||
return this.activeWorkflowRunner.getActiveWorkflows();
|
||||
const activeWorkflows = await this.activeWorkflowRunner.getActiveWorkflows();
|
||||
return activeWorkflows.map(workflow => workflow.id.toString()) as string[];
|
||||
}));
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user