Skip to content

Commit

Permalink
add internal history route (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnIckler authored Nov 8, 2024
1 parent cfef71d commit ee6b5fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/internal_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ee6b5fe

Please sign in to comment.