Skip to content

Commit

Permalink
Add internal waiting_list route for migration (#734)
Browse files Browse the repository at this point in the history
* add internal waiting_list route for migration

* don't break if the competition has no waiting list
  • Loading branch information
FinnIckler authored Nov 12, 2024
1 parent cbdfb4a commit e4cee81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/controllers/internal_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit e4cee81

Please sign in to comment.