diff --git a/app/controllers/api/v3/statements_controller.rb b/app/controllers/api/v3/statements_controller.rb index d12ad5efab..8a71779ac4 100644 --- a/app/controllers/api/v3/statements_controller.rb +++ b/app/controllers/api/v3/statements_controller.rb @@ -11,7 +11,7 @@ def index end def show - render json: to_json(statements_query.statement(ecf_id: statement_params[:id])) + render json: to_json(statements_query.statement(ecf_id: statement_params[:ecf_id])) end private @@ -25,7 +25,7 @@ def statements_query end def statement_params - params.permit(:id, filter: %i[cohort updated_since]) + params.permit(:ecf_id, filter: %i[cohort updated_since]) end def cohort_start_years diff --git a/config/routes.rb b/config/routes.rb index b853b63733..5e2521d23a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -177,7 +177,7 @@ put :void, path: "void" end - resources :statements, only: %i[index show] + resources :statements, only: %i[index show], param: :ecf_id end end