Skip to content

Commit a4d6be7

Browse files
committed
Correct radius and date for museums
1 parent 0a9cf2a commit a4d6be7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎server/app/controllers/api/itineraries_controller.rb‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@ def get_itinerary
88
# get restaurants
99
restaurants_hash = {}
1010
if params[:restaurants].downcase == "true"
11-
restaurants_hash["breakfast"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "restaurant", ["id", "name", "formatted_phone_number", "formatted_address", "rating", "website", "opening_hours", "price_level", "geometry"], "brunch", params[:date])
12-
restaurants_hash["lunch"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "restaurant", ["id", "name", "formatted_phone_number", "formatted_address", "rating", "website", "opening_hours", "price_level", "geometry"], "lunch", params[:date])
13-
restaurants_hash["dinner"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "restaurant", ["id", "name", "formatted_phone_number", "formatted_address", "rating", "website", "opening_hours", "price_level", "geometry"], "dinner", params[:date])
11+
restaurants_hash["breakfast"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "restaurant", ["id", "name", "formatted_phone_number", "formatted_address", "rating", "website", "opening_hours", "price_level", "geometry"], "brunch", 1000, params[:date])
12+
restaurants_hash["lunch"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "restaurant", ["id", "name", "formatted_phone_number", "formatted_address", "rating", "website", "opening_hours", "price_level", "geometry"], "lunch", 1000, params[:date])
13+
restaurants_hash["dinner"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "restaurant", ["id", "name", "formatted_phone_number", "formatted_address", "rating", "website", "opening_hours", "price_level", "geometry"], "dinner", 1000, params[:date])
1414
end
1515
itinerary << restaurants_hash
1616

1717
# get bars
1818
bars_hash = {}
1919
if params[:bars].downcase == "true"
20-
bars_hash["bars"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "bar", ["id", "name", "formatted_phone_number", "formatted_address", "rating", "price_level", "website", "opening_hours", "geometry"], params[:date])
20+
bars_hash["bars"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "bar", ["id", "name", "formatted_phone_number", "formatted_address", "rating", "price_level", "website", "opening_hours", "geometry"], 1000,params[:date])
2121
end
2222
itinerary << bars_hash
2323

2424
# get nature
2525
nature_hash = {}
2626
if params[:nature].downcase == "true"
27-
nature_hash["nature"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "park", ["id", "name", "formatted_address", "website", "geometry"], params[:date])
27+
nature_hash["nature"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "park", ["id", "name", "formatted_address", "website", "geometry"], 1000, params[:date])
2828
end
2929
itinerary << nature_hash
3030

3131
# get arts
3232
# TODO: get radius from request
3333
arts_hash = {}
3434
if params[:arts].downcase == "true"
35-
arts_hash["arts"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "museum", ["id", "name", "formatted_phone_number", "formatted_address", "website", "geometry", "opening_hours", "website"], params[:date], 10000)
35+
arts_hash["arts"] = PlacesUtils.get_places(params[:amt].to_i, params[:lat], params[:lon], "museum", ["id", "name", "formatted_phone_number", "formatted_address", "website", "geometry", "opening_hours", "website"], 10000, params[:date])
3636
end
3737
itinerary << arts_hash
3838

‎server/app/controllers/places_api.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class PlacesUtils
1313
ROSE_THIRD_KEY = "AIzaSyB6aCRNMXBNIlT4dUXI_c47Dgd8UeZ3mDQ"
1414
BRIE_API_KEY = "AIzaSyCEbuWklDLV0973ygPglKadB6sGnY4gFC4"
1515

16-
def self.get_places(places_count, lat, lon, type, place_properties, keyword = "", date = "2018", radius = 1000)
16+
def self.get_places(places_count, lat, lon, type, place_properties, keyword = "", radius = 1000, date = "2018")
1717
if type === "restaurant"
1818
request = RestClient::Request.execute(
1919
method: :get,

0 commit comments

Comments
 (0)