Add freshness headers to API

This commit is contained in:
Petko Bordjukov 2024-10-01 01:36:19 +03:00
parent 1018b93b11
commit 89dd1890fd
6 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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