mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
🐛 Fix saving credentials id as string (#2410)
This commit is contained in:
@@ -1917,10 +1917,13 @@ export default mixins(
|
||||
|
||||
if (nodeCredentials.id) {
|
||||
// Check whether the id is matching with a credential
|
||||
const credentialsForId = credentialOptions.find((optionData: ICredentialsResponse) => optionData.id === nodeCredentials.id);
|
||||
const credentialsId = nodeCredentials.id.toString(); // due to a fixed bug in the migration UpdateWorkflowCredentials (just sqlite) we have to cast to string and check later if it has been a number
|
||||
const credentialsForId = credentialOptions.find((optionData: ICredentialsResponse) =>
|
||||
optionData.id === credentialsId,
|
||||
);
|
||||
if (credentialsForId) {
|
||||
if (credentialsForId.name !== nodeCredentials.name) {
|
||||
node.credentials![nodeCredentialType].name = credentialsForId.name;
|
||||
if (credentialsForId.name !== nodeCredentials.name || typeof nodeCredentials.id === 'number') {
|
||||
node.credentials![nodeCredentialType] = { id: credentialsForId.id, name: credentialsForId.name };
|
||||
this.credentialsUpdated = true;
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user