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
|
def index
|
||||||
@events = current_conference.events.includes(:participations)
|
@events = current_conference.events.includes(:participations)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def halfnarp_friendly
|
||||||
|
@events = current_conference.events.includes(:track, :event_type)
|
||||||
|
render json: @events, include: [:track, :event_type]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,11 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
namespace :api do
|
namespace :api do
|
||||||
resources :conferences, only: [] 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 :speakers, only: :index
|
||||||
resources :tracks, only: :index
|
resources :tracks, only: :index
|
||||||
resources :event_types, only: :index
|
resources :event_types, only: :index
|
||||||
|
|
Loading…
Reference in New Issue