mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -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 {
|
function pruneParamValues(): void {
|
||||||
if (!state.paramValue.value) {
|
const { value, schema } = state.paramValue;
|
||||||
|
if (!value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const valueKeys = Object.keys(state.paramValue.value);
|
|
||||||
valueKeys.forEach((key) => {
|
const schemaKeys = new Set(schema.map((s) => s.id));
|
||||||
if (state.paramValue.value && state.paramValue.value[key] === null) {
|
for (const key of Object.keys(value)) {
|
||||||
delete state.paramValue.value[key];
|
if (value[key] === null || !schemaKeys.has(key)) {
|
||||||
|
delete value[key];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|
Loading…
Reference in a new issue