diff options
author | zsloan | 2020-06-17 15:21:41 -0500 |
---|---|---|
committer | zsloan | 2020-06-17 15:21:41 -0500 |
commit | 15f5df7fe795a32e2d61dd11f825e53b1a1175ec (patch) | |
tree | 02d4f971b7562da3f3c73511f41ff45c068d3ab0 | |
parent | ea47eb228b1224ea83e3f50a056bf715b3bf5ec6 (diff) | |
download | genenetwork2-15f5df7fe795a32e2d61dd11f825e53b1a1175ec.tar.gz |
Fixed issue where removing traits from collection didn't work; previous fix wasn't working for some reason
-rw-r--r-- | wqflask/wqflask/collect.py | 2 | ||||
-rw-r--r-- | wqflask/wqflask/static/new/javascript/search_results.js | 34 | ||||
-rw-r--r-- | wqflask/wqflask/templates/collections/view.html | 5 |
3 files changed, 6 insertions, 35 deletions
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py index e8459821..42a09fed 100644 --- a/wqflask/wqflask/collect.py +++ b/wqflask/wqflask/collect.py @@ -157,7 +157,7 @@ def remove_traits(): params = request.form uc_id = params['uc_id'] - traits_to_remove = params.getlist('traits[]') + traits_to_remove = params['trait_list'] traits_to_remove = process_traits(traits_to_remove) members_now = g.user_session.remove_traits_from_collection(uc_id, traits_to_remove) diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js index 115dac13..39aae113 100644 --- a/wqflask/wqflask/static/new/javascript/search_results.js +++ b/wqflask/wqflask/static/new/javascript/search_results.js @@ -137,40 +137,6 @@ $(function() { } }; - remove = function() { - var traits, uc_id; - checked_traits = $("#trait_table input:checked"); - traits = checked_traits.map(function() { - return $(this).val(); - }).get(); - console.log("checked length is:", traits.length); - console.log("checked is:", traits); - if ( $("#uc_id").length ) { - uc_id = $("#uc_id").val(); - return $.ajax({ - type: "POST", - url: "/collections/remove", - data: { - uc_id: uc_id, - traits: traits - }, - success: removed_traits - }); - } - else { - collection_name = $("#collection_name").val(); - return $.ajax({ - type: "POST", - url: "/collections/remove", - data: { - collection_name: collection_name, - traits: traits - }, - success: removed_traits - }); - } - }; - submit_bnw = function() { trait_data = get_traits_from_table("trait_table", "submit_bnw") } diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index ec0e0220..b56a89da 100644 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -232,6 +232,11 @@ $("#remove").on("click", function() { url = $(this).data("url") + traits = $("#trait_table input:checked").map(function() { + return $(this).val(); + }).get(); + $("#trait_list").val(traits) + return submit_special(url) }); |