From ee6b5fe26cf88f7959280d79b53becd57c6ca136 Mon Sep 17 00:00:00 2001 From: FinnIckler Date: Fri, 8 Nov 2024 10:52:39 +0100 Subject: [PATCH] add internal history route (#730) --- app/controllers/internal_controller.rb | 6 ++++++ config/routes.rb | 1 + 2 files changed, 7 insertions(+) diff --git a/app/controllers/internal_controller.rb b/app/controllers/internal_controller.rb index 136fe1d2..1eb0488c 100644 --- a/app/controllers/internal_controller.rb +++ b/app/controllers/internal_controller.rb @@ -115,4 +115,10 @@ def show_registration registration = Registration.find(attendee_id) render json: registration end + + def history + attendee_id = params.require(:attendee_id) + history = RegistrationHistory.find(attendee_id) + render json: history + end end diff --git a/config/routes.rb b/config/routes.rb index a748c3b1..8cf590d6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,6 +13,7 @@ get '/api/internal/v1/:competition_id/registrations', to: 'internal#list_registrations' post '/api/internal/v1/:competition_id/add', to: 'internal#create' get '/api/internal/v1/:attendee_id', to: 'internal#show_registration' + get '/api/internal/v1/:attendee_id/history', to: 'internal#history' get '/api/internal/v1/users/:user_id/registrations', to: 'internal#registrations_for_user' get '/api/v1/register', to: 'registration#show' post '/api/v1/register', to: 'registration#create'