mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
SeaGL currently uses OSEM as a backend, but still has a static website serving as our public interface. The API endpoints have a great amount of data, but without the jsonp callback paramater, embedding the data is a bit difficult. This change just adds the jsonp callback param to all the API endpoints. This should be a NOOP for anyone using direct json calls, but will allow cross domain requests that require jsonp.
20 lines
615 B
Ruby
20 lines
615 B
Ruby
module Api
|
|
module V1
|
|
class SpeakersController < Api::BaseController
|
|
load_resource :conference, find_by: :short_title
|
|
respond_to :json
|
|
|
|
def index
|
|
if @conference
|
|
users = User.joins(event_users: { event: { program: :conference} })
|
|
users = users.where(conferences: { short_title: @conference.short_title })
|
|
else
|
|
users = User.joins(:event_users)
|
|
end
|
|
|
|
users = users.where(event_users: {event_role: :speaker}).uniq
|
|
render json: users, each_serializer: SpeakerSerializer, callback: params['callback']
|
|
end
|
|
end
|
|
end
|
|
end
|