mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(core): Update cached project association when moving a workflow (#19227)
This commit is contained in:
@@ -94,6 +94,14 @@ export class OwnershipService {
|
|||||||
return sharedWorkflow.project;
|
return sharedWorkflow.project;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async setWorkflowProjectCacheEntry(workflowId: string, project: Project): Promise<Project> {
|
||||||
|
void this.cacheService.setHash('workflow-project', {
|
||||||
|
[workflowId]: this.copyProject(project),
|
||||||
|
});
|
||||||
|
|
||||||
|
return project;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the user who owns the personal project, or `null` if non-personal project.
|
* Retrieve the user who owns the personal project, or `null` if non-personal project.
|
||||||
* Personal project ownership is **immutable**.
|
* Personal project ownership is **immutable**.
|
||||||
|
|||||||
@@ -344,7 +344,10 @@ export class EnterpriseWorkflowService {
|
|||||||
// @ts-ignore CAT-957
|
// @ts-ignore CAT-957
|
||||||
await this.workflowRepository.update({ id: workflow.id }, { parentFolder });
|
await this.workflowRepository.update({ id: workflow.id }, { parentFolder });
|
||||||
|
|
||||||
// 10. try to activate it again if it was active
|
// 10. Update potential cached project association
|
||||||
|
await this.ownershipService.setWorkflowProjectCacheEntry(workflow.id, destinationProject);
|
||||||
|
|
||||||
|
// 11. try to activate it again if it was active
|
||||||
if (wasActive) {
|
if (wasActive) {
|
||||||
return await this.attemptWorkflowReactivation(workflowId);
|
return await this.attemptWorkflowReactivation(workflowId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user