diff --git a/ui/src/pages/Mappings.jsx b/ui/src/pages/Mappings.jsx index c970bbf..d49f6fe 100644 --- a/ui/src/pages/Mappings.jsx +++ b/ui/src/pages/Mappings.jsx @@ -130,14 +130,14 @@ export default function Mappings({ source }) { valueKey(x.extracted_value) === k ? { ...x, output: updated.output } : x )) } else { - await api.createMapping({ + const created = await api.createMapping({ source_name: source, rule_name: row.rule_name, input_value: row.extracted_value, output }) setAllValues(av => av.map(x => - valueKey(x.extracted_value) === k ? { ...x, is_mapped: true, output } : x + valueKey(x.extracted_value) === k ? { ...x, is_mapped: true, mapping_id: created.id, output } : x )) } setDrafts(d => { const n = { ...d }; delete n[k]; return n })