mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
⚡ Overwrite credential data only if there is no data set yet
This commit is contained in:
parent
6aaae1ef6c
commit
313c8c14dc
|
@ -38,7 +38,12 @@ class CredentialsOverwritesClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
const returnData = JSON.parse(JSON.stringify(data));
|
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;
|
return returnData;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue