Skip to content

Commit

Permalink
fix(mapping) fix deletion of mapped field
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Narcisi committed Sep 28, 2023
1 parent ccb26f5 commit 0dfda62
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/gn_module_import/routes/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ def update_mapping(mappingtype, mapping, scope):
raise BadRequest(*e.args)
if mappingtype == "FIELD":
mapping.values.update(request.json)
keys = list(mapping.values.keys())
for k in keys:
if k not in request.json:
mapping.values.pop(k)
elif mappingtype == "CONTENT":
for key, value in request.json.items():
if key not in mapping.values:
Expand Down

0 comments on commit 0dfda62

Please sign in to comment.