diff --git a/app/controllers/api/v1/conferences_controller.rb b/app/controllers/api/v1/conferences_controller.rb index 77d6f053..4a851b94 100644 --- a/app/controllers/api/v1/conferences_controller.rb +++ b/app/controllers/api/v1/conferences_controller.rb @@ -2,6 +2,11 @@ class Api::V1::ConferencesController < Api::BaseController respond_to :json def index - render :json => Conference.all, :serializer => ConferencesArraySerializer + if params[:conference_id].blank? + conferences = Conference.all + else + conferences = Conference.find_all_by_guid(params[:conference_id]) + end + render :json => conferences, :serializer => ConferencesArraySerializer end end diff --git a/config/routes.rb b/config/routes.rb index 2b78d62a..0cbeab15 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -65,6 +65,7 @@ Osem::Application.routes.draw do namespace :api, defaults: {format: 'json'} do namespace :v1 do resources :conferences, :only => :index do + resources :conferences, :only => :index resources :rooms, :only => :index resources :tracks, :only => :index resources :speakers, :only => :index