Skip to content

Commit

Permalink
Remove route and controller action no longer used
Browse files Browse the repository at this point in the history
Now that Argo uses the `Dor::Services::Client.virtual_objects` method, which hits `VirtualObjectsController` instead of the route and controller action removed in this branch, no code hits this anymore and can be removed.
  • Loading branch information
mjgiarlo committed Sep 19, 2019
1 parent 44563c4 commit a153d1f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 86 deletions.
18 changes: 0 additions & 18 deletions app/controllers/objects_controller.rb
Expand Up @@ -40,24 +40,6 @@ def create
end
end

# TODO: Remove this once Argo, in stage and prod, uses a version of dor-services-client that no longer hits this endpoint
# Handles updates to the record.
# Presently this only needs to handle the merge object use case.
# Do this by providing: constituent_ids => ['druid:123', 'druid:345']
def update
# validate that the constituent_ids parameter is an present, raises ActionController::ParameterMissing
params.require(:constituent_ids)
filtered_params = params.permit(constituent_ids: [])
raise ActionController::ParameterMissing, 'constituent_ids must be an array' unless filtered_params[:constituent_ids]

# Update the constituent relationship
errors = ConstituentService.new(parent_druid: params[:id]).add(child_druids: filtered_params[:constituent_ids])

return render json: { errors: errors }, status: :unprocessable_entity if errors

head :no_content
end

def show
render json: Cocina::Mapper.build(@item)
end
Expand Down
3 changes: 1 addition & 2 deletions config/routes.rb
Expand Up @@ -26,8 +26,7 @@

resources :background_job_results, only: [:show], defaults: { format: :json }

# TODO: Remove :update once Argo, in stage and prod, uses a version of dor-services-client that no longer hits this endpoint
resources :objects, only: [:create, :update, :show] do
resources :objects, only: [:create, :show] do
member do
post 'publish'
post 'update_marc_record'
Expand Down
66 changes: 0 additions & 66 deletions spec/requests/virtual_merge_spec.rb

This file was deleted.

0 comments on commit a153d1f

Please sign in to comment.