API login/logout with http header token
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
class Api::Restaurant::ZonesController < Api::ApiController
|
||||
|
||||
def index
|
||||
render json: Zone.includes([:tables, :rooms]).where("is_active = true")
|
||||
if (params[:filter] && params[:filter] = "all" )
|
||||
@all_tables = Table.active
|
||||
@all_rooms = Room.active
|
||||
else
|
||||
@zones = Zone.includes([:tables, :rooms]).where("is_active = true")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def zones_params
|
||||
params.permit(:filter)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user