From 12f680cbc4b43385bfa63ffe3936f9c42cf90f46 Mon Sep 17 00:00:00 2001 From: Ryan Abbott Date: Mon, 17 Apr 2017 11:48:03 -0400 Subject: [PATCH] MMT-922: Updates ajax request to provider collection endpoints to use POST --- app/assets/javascripts/order_policies.coffee | 6 +++++- app/assets/javascripts/service_management.coffee | 6 +++++- config/routes.rb | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/order_policies.coffee b/app/assets/javascripts/order_policies.coffee index cce9a82af..2dc13492f 100644 --- a/app/assets/javascripts/order_policies.coffee +++ b/app/assets/javascripts/order_policies.coffee @@ -71,7 +71,11 @@ $(document).ready -> # to retrieve data specific to the selected values if selectedValues.length > 0 # Not providing any concept ids will result in all items coming back, avoid that - $.ajax '/provider_collections?' + $.param('concept_id': selectedValues) + '&page_size=' + selectedValues.length, + $.ajax '/provider_collections', + method: 'POST' + data: + concept_id: selectedValues + page_size: selectedValues.length success: (data) -> # Sets the selected values of the chooser collectionsChooser.setToVal(data.items) diff --git a/app/assets/javascripts/service_management.coffee b/app/assets/javascripts/service_management.coffee index 29b505ee9..3e40d1f39 100644 --- a/app/assets/javascripts/service_management.coffee +++ b/app/assets/javascripts/service_management.coffee @@ -91,7 +91,11 @@ $(document).ready -> # to retrieve data specific to the selected values if selectedValues.length > 0 # Not providing any concept ids will result in all items coming back, avoid that - $.ajax '/provider_collections?' + $.param('concept_id': selectedValues) + '&page_size=' + selectedValues.length, + $.ajax '/provider_collections', + method: 'POST' + data: + concept_id: selectedValues + page_size: selectedValues.length success: (data) -> # Sets the selected values of the chooser collectionsChooser.setToVal(data.items) diff --git a/config/routes.rb b/config/routes.rb index 7d38127a2..c451f7706 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -72,6 +72,7 @@ # API Endpoints for Chooser implementations get 'provider_collections' => 'manage_cmr#provider_collections' + post 'provider_collections' => 'manage_cmr#provider_collections' get 'service_implementations_with_datasets' => 'manage_cmr#service_implementations_with_datasets' get 'datasets_for_service_implementation' => 'manage_cmr#datasets_for_service_implementation'