mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
⚡ Overwrite credential data only if there is no data set yet
This commit is contained in:
@@ -38,7 +38,12 @@ class CredentialsOverwritesClass {
|
||||
}
|
||||
|
||||
const returnData = JSON.parse(JSON.stringify(data));
|
||||
Object.assign(returnData, overwrites);
|
||||
// Overwrite only if there is currently no data set
|
||||
for (const key of Object.keys(overwrites)) {
|
||||
if ([null, undefined, ''].includes(returnData[key])) {
|
||||
returnData[key] = overwrites[key];
|
||||
}
|
||||
}
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user