From 4e35e2241e5f50ed9743f826ea3511c06fbadaa6 Mon Sep 17 00:00:00 2001 From: Alex Dolski Date: Thu, 11 Jan 2024 12:41:18 -0600 Subject: [PATCH] Fix Add Collection button in the collections tab --- app/assets/javascripts/units.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/assets/javascripts/units.js b/app/assets/javascripts/units.js index 9ece64c2..f8ebb027 100644 --- a/app/assets/javascripts/units.js +++ b/app/assets/javascripts/units.js @@ -71,6 +71,14 @@ const UnitView = { const url = ROOT_URL + "/units/" + unitID + "/collections"; $.get(url, function(data) { $("#collections-tab-content").html(data); + $('.add-collection').on("click", function() { + const url = ROOT_URL + "/collections/new" + + "?collection%5Binstitution_id%5D=" + institutionID + + "&primary_unit_id=" + unitID; + $.get(url, function(data) { + $("#add-collection-modal .modal-body").html(data); + }); + }); }); });