mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 06:01:12 +00:00
API with more options, includes #712
This commit is contained in:
parent
28e55f3f50
commit
ecef151f91
7 changed files with 86 additions and 38 deletions
|
|
@ -1,15 +1,12 @@
|
|||
module Api
|
||||
module V1
|
||||
class RoomsController < Api::BaseController
|
||||
load_resource :conference, find_by: :short_title
|
||||
respond_to :json
|
||||
|
||||
def index
|
||||
if params[:conference_id].blank?
|
||||
rooms = Room.all
|
||||
else
|
||||
conference = Conference.find_by_guid(params[:conference_id])
|
||||
rooms = conference.rooms
|
||||
end
|
||||
@conference ? (rooms = @conference.rooms) : (rooms = Room.all)
|
||||
|
||||
respond_with rooms
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue