Spaces:
Sleeping
Sleeping
OnlyBiggg
commited on
Commit
·
ac1f8b7
1
Parent(s):
b8799b3
fi
Browse files
app/dialogflow/services/dialog_service.py
CHANGED
|
@@ -57,7 +57,7 @@ class DialogService:
|
|
| 57 |
try:
|
| 58 |
route_ids = []
|
| 59 |
response = await api.get(f'/booking/api/v2/routes/from/{origin}/to/{dest}')
|
| 60 |
-
if response.get("
|
| 61 |
if response.get("Data"):
|
| 62 |
data = response.get("Data")
|
| 63 |
route_ids = [ route.get("Id", None) for route in data ]
|
|
@@ -90,6 +90,8 @@ class DialogService:
|
|
| 90 |
@staticmethod
|
| 91 |
async def search_trip(from_time: int, to_time: int, route_ids: list[int], ticket_count: int = 1):
|
| 92 |
try:
|
|
|
|
|
|
|
| 93 |
payload = { k: v for k, v in {
|
| 94 |
"channel": "web_client",
|
| 95 |
"only_online_trip": True,
|
|
|
|
| 57 |
try:
|
| 58 |
route_ids = []
|
| 59 |
response = await api.get(f'/booking/api/v2/routes/from/{origin}/to/{dest}')
|
| 60 |
+
if response.get("Status") == 200:
|
| 61 |
if response.get("Data"):
|
| 62 |
data = response.get("Data")
|
| 63 |
route_ids = [ route.get("Id", None) for route in data ]
|
|
|
|
| 90 |
@staticmethod
|
| 91 |
async def search_trip(from_time: int, to_time: int, route_ids: list[int], ticket_count: int = 1):
|
| 92 |
try:
|
| 93 |
+
if len(route_ids) == 0:
|
| 94 |
+
return []
|
| 95 |
payload = { k: v for k, v in {
|
| 96 |
"channel": "web_client",
|
| 97 |
"only_online_trip": True,
|