Skip to content

Commit

Permalink
Finished implementing strong parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
nwalker2398 committed Feb 16, 2024
1 parent 3e42bfb commit 8cf5c1a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/api/v1/resources_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def index
statuses = ['pending', 'processing', 'failure', 'ready']

per_page = 50
status = statuses.include?(params[:status].downcase) ? statuses.index(params[:status].downcase) : params[:status]
status = statuses.include?(index_params[:status].downcase) ? statuses.index(index_params[:status].downcase) : index_params[:status]
status = status.is_a?(String) ? status.downcase : status
page = Integer(params[:page])
identifier = params[:identifier]
page = Integer(index_params[:page])
identifier = index_params[:identifier]

resources = Resource
identifier && resources = resources.where(identifier: identifier)
Expand All @@ -76,7 +76,7 @@ def create_params
end

def index_params
params.require(:resource).permit(:status, :page, :pcdm_type)
params.permit(:status, :page, :identifier, :format)
end
end
end
Expand Down

0 comments on commit 8cf5c1a

Please sign in to comment.