Spaces:
Sleeping
Sleeping
OnlyBiggg
commited on
Commit
·
bb40803
1
Parent(s):
9ac06da
fix
Browse files
app/dialogflow/services/dialog_service.py
CHANGED
|
@@ -67,10 +67,10 @@ class DialogService:
|
|
| 67 |
raise Exception("Error fetching seats data")
|
| 68 |
|
| 69 |
async def search_all_route_ids(self, origin_code: str = None, from_id: int = None, orign_ids: int = None, dest_code: str = None, to_id: str = None, dest_ids: str = None):
|
|
|
|
| 70 |
route_ids = await self.search_route_ids_one_way_by_metadata(origin_code, from_id, orign_ids, dest_code, to_id, dest_ids)
|
| 71 |
-
if len(route_ids)
|
| 72 |
-
|
| 73 |
-
route_ids = await self.search_route_ids_one_way_by_origin_dest_code(origin_code, dest_code)
|
| 74 |
return route_ids
|
| 75 |
@staticmethod
|
| 76 |
async def seats_trip(route_id: int, trip_id:int, departure_date: str, departure_time: str, kind: str):
|
|
|
|
| 67 |
raise Exception("Error fetching seats data")
|
| 68 |
|
| 69 |
async def search_all_route_ids(self, origin_code: str = None, from_id: int = None, orign_ids: int = None, dest_code: str = None, to_id: str = None, dest_ids: str = None):
|
| 70 |
+
print(from_id)
|
| 71 |
route_ids = await self.search_route_ids_one_way_by_metadata(origin_code, from_id, orign_ids, dest_code, to_id, dest_ids)
|
| 72 |
+
if len(route_ids) == 0:
|
| 73 |
+
route_ids = await self.search_route_ids_one_way_by_origin_dest_code(origin_code, dest_code)
|
|
|
|
| 74 |
return route_ids
|
| 75 |
@staticmethod
|
| 76 |
async def seats_trip(route_id: int, trip_id:int, departure_date: str, departure_time: str, kind: str):
|
common/external/external_api.py
CHANGED
|
@@ -50,7 +50,6 @@ class API():
|
|
| 50 |
url = f"{api_base}{endpoint}"
|
| 51 |
else:
|
| 52 |
url = f"{API_BASE_URL}{endpoint}"
|
| 53 |
-
print(url)
|
| 54 |
access_token = await get_access_token()
|
| 55 |
headers = headers or {}
|
| 56 |
headers.setdefault("Content-Type", "application/json")
|
|
|
|
| 50 |
url = f"{api_base}{endpoint}"
|
| 51 |
else:
|
| 52 |
url = f"{API_BASE_URL}{endpoint}"
|
|
|
|
| 53 |
access_token = await get_access_token()
|
| 54 |
headers = headers or {}
|
| 55 |
headers.setdefault("Content-Type", "application/json")
|