Skip to content

Commit

Permalink
MMT-922: Updates ajax request to provider collection endpoints to use…
Browse files Browse the repository at this point in the history
… POST
  • Loading branch information
abbottry committed Apr 18, 2017
1 parent 5663e7e commit 12f680c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/assets/javascripts/order_policies.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion app/assets/javascripts/service_management.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit 12f680c

Please sign in to comment.