Limit data returned by halfnarp-friendly endpoint
This commit is contained in:
parent
7a64633ac0
commit
15f2a4d1d1
|
@ -9,6 +9,5 @@ class Api::EventsController < Api::ApplicationController
|
||||||
|
|
||||||
def halfnarp_friendly
|
def halfnarp_friendly
|
||||||
@events = current_conference.events.joins(:proposition).includes(:track, :event_type).where.not(propositions: {status: :rejected})
|
@events = current_conference.events.joins(:proposition).includes(:track, :event_type).where.not(propositions: {status: :rejected})
|
||||||
render json: @events, include: [:track, :event_type]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
json.array! @events do |event|
|
||||||
|
json.id event.id
|
||||||
|
json.title event.title
|
||||||
|
json.abstract event.abstract
|
||||||
|
json.track_id event.track_id
|
||||||
|
|
||||||
|
json.track do
|
||||||
|
json.name = event.track.name
|
||||||
|
end
|
||||||
|
json.event_type do
|
||||||
|
json.name event.event_type.name
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue