Fix API endpoints conferences/id/rooms/ & tracks/ issue #874

This commit is contained in:
Nishanth Vijayan 2016-03-13 21:19:58 +05:30
parent cb9cf0359b
commit 55cfc8ff60
2 changed files with 2 additions and 3 deletions

View file

@ -8,8 +8,7 @@ module Api
if params[:conference_id].blank?
rooms = Room.all
else
conference = Conference.find_by_guid(params[:conference_id])
rooms = conference.venue.rooms if conference.venue
@conference.venue ? (rooms = @conference.venue.rooms) : (rooms = [])
end
respond_with rooms
end

View file

@ -5,7 +5,7 @@ module Api
respond_to :json
def index
@conference ? (tracks = @conference.tracks) : (tracks = Track.all)
@conference ? (tracks = @conference.program.tracks) : (tracks = Track.all)
respond_with tracks
end