Spaces:
Sleeping
Sleeping
OnlyBiggg
commited on
Commit
·
11749d8
1
Parent(s):
08ca376
fix: pickup and dropoff
Browse files
app/dialogflow/services/dialog_service.py
CHANGED
|
@@ -222,13 +222,14 @@ class DialogService:
|
|
| 222 |
"wayId": way_id,
|
| 223 |
}.items() if v is not None}
|
| 224 |
response = await api.get(api_base=settings.API_BASE_URL_VATO, endpoint=f"/stops/{route_id}", params=params)
|
|
|
|
|
|
|
| 225 |
data = response["data"]
|
| 226 |
return data
|
| 227 |
except Exception as e:
|
| 228 |
print(e)
|
| 229 |
raise Exception("Error fetching stops data")
|
| 230 |
|
| 231 |
-
|
| 232 |
async def pickup_list(self, route_id: int, way_id: int):
|
| 233 |
try:
|
| 234 |
data = await self.stops(route_id, way_id)
|
|
|
|
| 222 |
"wayId": way_id,
|
| 223 |
}.items() if v is not None}
|
| 224 |
response = await api.get(api_base=settings.API_BASE_URL_VATO, endpoint=f"/stops/{route_id}", params=params)
|
| 225 |
+
if not response.get("data"):
|
| 226 |
+
return []
|
| 227 |
data = response["data"]
|
| 228 |
return data
|
| 229 |
except Exception as e:
|
| 230 |
print(e)
|
| 231 |
raise Exception("Error fetching stops data")
|
| 232 |
|
|
|
|
| 233 |
async def pickup_list(self, route_id: int, way_id: int):
|
| 234 |
try:
|
| 235 |
data = await self.stops(route_id, way_id)
|