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
@conferences = Conference.all
fresh_when @conferences
end
end

View File

@ -5,5 +5,6 @@ class Api::EventTypesController < Api::ApplicationController
def index
@event_types = current_conference.event_types.includes(:translations)
fresh_when @event_types
end
end

View File

@ -5,5 +5,6 @@ class Api::HallsController < Api::ApplicationController
def index
@halls = current_conference.halls
fresh_when @halls
end
end

View File

@ -5,5 +5,7 @@ class Api::SlotsController < Api::ApplicationController
def index
@slots = current_conference.slots
fresh_when @slots
end
end

View File

@ -5,5 +5,6 @@ class Api::SpeakersController < Api::ApplicationController
def index
@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

View File

@ -5,5 +5,6 @@ class Api::TracksController < Api::ApplicationController
def index
@tracks = current_conference.tracks.includes(:translations)
fresh_when @tracks
end
end