diff options
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/templates/case_attributes.html | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/wqflask/wqflask/templates/case_attributes.html b/wqflask/wqflask/templates/case_attributes.html index c2db7ef8..9ed02ed4 100644 --- a/wqflask/wqflask/templates/case_attributes.html +++ b/wqflask/wqflask/templates/case_attributes.html @@ -283,19 +283,21 @@ let node = $(this).parents("tr") let diff = {}; + let nodeId = $(this).parents("tr").data("id"); diff["Deletion"] = { name: node.find(".name").data("original-value"), description: node.find(".description").data("original-value"), id: node.data("id")} console.log(diff) - $.ajax({ - type: "POST", - data: {"data": JSON.stringify(diff)}, - url: '{{ url_for("metadata_edit.update_case_attributes") }}', - success: function(data, status, xhr) { - location.reload(); - } - }); + if (nodeId){ + $.ajax({ + type: "POST", + data: {"data": JSON.stringify(diff)}, + url: '{{ url_for("metadata_edit.update_case_attributes") }}', + success: function(data, status, xhr) { + location.reload(); + } + })} }); }); </script> |