Add freshness headers to API
This commit is contained in:
parent
1018b93b11
commit
89dd1890fd
|
@ -3,5 +3,6 @@ class Api::ConferencesController < Api::ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@conferences = Conference.all
|
@conferences = Conference.all
|
||||||
|
fresh_when @conferences
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,5 +5,6 @@ class Api::EventTypesController < Api::ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@event_types = current_conference.event_types.includes(:translations)
|
@event_types = current_conference.event_types.includes(:translations)
|
||||||
|
fresh_when @event_types
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,5 +5,6 @@ class Api::HallsController < Api::ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@halls = current_conference.halls
|
@halls = current_conference.halls
|
||||||
|
fresh_when @halls
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,5 +5,7 @@ class Api::SlotsController < Api::ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@slots = current_conference.slots
|
@slots = current_conference.slots
|
||||||
|
|
||||||
|
fresh_when @slots
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,5 +5,6 @@ class Api::SpeakersController < Api::ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@speakers = PersonalProfile.joins(user: {participations: {event: :proposition}}).where(events: {id: current_conference.approved_events.pluck(:id)}, conference: current_conference).distinct
|
@speakers = PersonalProfile.joins(user: {participations: {event: :proposition}}).where(events: {id: current_conference.approved_events.pluck(:id)}, conference: current_conference).distinct
|
||||||
|
fresh_when @speakers
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,5 +5,6 @@ class Api::TracksController < Api::ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@tracks = current_conference.tracks.includes(:translations)
|
@tracks = current_conference.tracks.includes(:translations)
|
||||||
|
fresh_when @tracks
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue