fix: Remove foreign credentials when copying nodes or duplicating workflow (#4880)

* fix: Remove foreign credentials when copying nodes or duplicating workflow

* chore: fix linting issue
This commit is contained in:
Alex Grozav
2022-12-12 12:59:16 +02:00
committed by GitHub
parent 4765d767e3
commit 7d2e2ee0f7
5 changed files with 28 additions and 2 deletions

View File

@@ -125,8 +125,10 @@ export default mixins(showMessage, workflowHelpers, restApi).extend({
try {
let workflowToUpdate: IWorkflowDataUpdate | undefined;
if (currentWorkflowId !== PLACEHOLDER_EMPTY_WORKFLOW_ID) {
const { createdAt, updatedAt, ...workflow } = await this.restApi().getWorkflow(this.data.id);
const { createdAt, updatedAt, usedCredentials, ...workflow } = await this.restApi().getWorkflow(this.data.id);
workflowToUpdate = workflow;
this.removeForeignCredentialsFromWorkflow(workflowToUpdate, this.credentialsStore.allCredentials);
}
const saved = await this.saveAsNewWorkflow({