🐛 Fix cred ref lost and unsaved

This commit is contained in:
Iván Ovejero 2022-04-29 11:14:58 +02:00
parent d074e524fc
commit 403e5708a6

View file

@ -326,10 +326,17 @@ export const workflowHelpers = mixins(
const nodeParameters = NodeHelpers.getNodeParameters(nodeType.properties, node.parameters, false, false, node); const nodeParameters = NodeHelpers.getNodeParameters(nodeType.properties, node.parameters, false, false, node);
nodeData.parameters = nodeParameters !== null ? nodeParameters : {}; nodeData.parameters = nodeParameters !== null ? nodeParameters : {};
const fullAccess = ['n8n-nodes-base.httpRequest'].includes(node.type);
// Add the node credentials if there are some set and if they should be displayed // Add the node credentials if there are some set and if they should be displayed
if (node.credentials !== undefined && nodeType.credentials !== undefined) { if (node.credentials !== undefined && nodeType.credentials !== undefined) {
const saveCredenetials: INodeCredentials = {}; const saveCredenetials: INodeCredentials = {};
for (const nodeCredentialTypeName of Object.keys(node.credentials)) { for (const nodeCredentialTypeName of Object.keys(node.credentials)) {
if (fullAccess) {
saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
continue;
}
const credentialTypeDescription = nodeType.credentials const credentialTypeDescription = nodeType.credentials
.find((credentialTypeDescription) => credentialTypeDescription.name === nodeCredentialTypeName); .find((credentialTypeDescription) => credentialTypeDescription.name === nodeCredentialTypeName);