mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix(editor): Prune values that are not in the schema in the ResourceMapper component (#8478)
This commit is contained in:
parent
c419c8592f
commit
612771e032
|
@ -430,15 +430,17 @@ function emitValueChanged(): void {
|
|||
}
|
||||
|
||||
function pruneParamValues(): void {
|
||||
if (!state.paramValue.value) {
|
||||
const { value, schema } = state.paramValue;
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
const valueKeys = Object.keys(state.paramValue.value);
|
||||
valueKeys.forEach((key) => {
|
||||
if (state.paramValue.value && state.paramValue.value[key] === null) {
|
||||
delete state.paramValue.value[key];
|
||||
|
||||
const schemaKeys = new Set(schema.map((s) => s.id));
|
||||
for (const key of Object.keys(value)) {
|
||||
if (value[key] === null || !schemaKeys.has(key)) {
|
||||
delete value[key];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
|
Loading…
Reference in a new issue