Add a halfnarp-friendly version of the events API
This commit is contained in:
parent
bf278693b3
commit
60d84ffc7c
|
@ -5,4 +5,9 @@ class Api::EventsController < Api::ApplicationController
|
|||
def index
|
||||
@events = current_conference.events.includes(:participations)
|
||||
end
|
||||
|
||||
def halfnarp_friendly
|
||||
@events = current_conference.events.includes(:track, :event_type)
|
||||
render json: @events, include: [:track, :event_type]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,7 +13,11 @@ Rails.application.routes.draw do
|
|||
|
||||
namespace :api do
|
||||
resources :conferences, only: [] do
|
||||
resources :events, only: :index
|
||||
resources :events, only: :index do
|
||||
collection do
|
||||
get :halfnarp_friendly
|
||||
end
|
||||
end
|
||||
resources :speakers, only: :index
|
||||
resources :tracks, only: :index
|
||||
resources :event_types, only: :index
|
||||
|
|
Loading…
Reference in New Issue