diff --git a/app/controllers/internal_controller.rb b/app/controllers/internal_controller.rb index 1eb0488c..34b634df 100644 --- a/app/controllers/internal_controller.rb +++ b/app/controllers/internal_controller.rb @@ -121,4 +121,14 @@ def history history = RegistrationHistory.find(attendee_id) render json: history end + + def waiting_list + competition_id = params.require(:competition_id) + begin + waiting_list = WaitingList.find(competition_id) + render json: waiting_list.entries + rescue Dynamoid::Errors::RecordNotFound + render json: [] + end + end end diff --git a/config/routes.rb b/config/routes.rb index 8cf590d6..41561bd8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,6 +11,7 @@ get '/healthcheck', to: 'healthcheck#index' post '/api/internal/v1/update_payment', to: 'internal#update_payment_status' get '/api/internal/v1/:competition_id/registrations', to: 'internal#list_registrations' + get '/api/internal/v1/:competition_id/waiting_list', to: 'internal#waiting_list' 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'