Spaces:
Sleeping
Sleeping
OnlyBiggg
commited on
Commit
·
9ed1dc8
1
Parent(s):
7d8084a
fix
Browse files- app/api/routes.py +2 -1
app/api/routes.py
CHANGED
|
@@ -35,7 +35,6 @@ def get_param_from_dialogflow(body: any):
|
|
| 35 |
raw_date = parameters.get("date")
|
| 36 |
if raw_date is not None:
|
| 37 |
raw_date = to_datetime_from_Dialogflow(raw_date)
|
| 38 |
-
print(raw_date)
|
| 39 |
raw_departure_city = parameters.get("departure_city")
|
| 40 |
raw_destination_city = parameters.get("destination_city")
|
| 41 |
raw_ticket_number = parameters.get("ticket_number")
|
|
@@ -216,11 +215,13 @@ async def booking_trip(request: Request) -> Response:
|
|
| 216 |
"ticket_count": ticket_count,
|
| 217 |
"sort_by": ["price", "departure_time"]
|
| 218 |
}
|
|
|
|
| 219 |
try:
|
| 220 |
response = await api.post("/search/trips", payload=payload)
|
| 221 |
if response.get('status') == 200:
|
| 222 |
data = response["data"]["items"]
|
| 223 |
total = response["data"]["total"]
|
|
|
|
| 224 |
if total > 0:
|
| 225 |
list_raw_departure_times = sorted(list(set([ trip["raw_departure_time"] for trip in data])))
|
| 226 |
schedule_time_trip = "**" + "** | **".join(map(str, list_raw_departure_times)) + "**"
|
|
|
|
| 35 |
raw_date = parameters.get("date")
|
| 36 |
if raw_date is not None:
|
| 37 |
raw_date = to_datetime_from_Dialogflow(raw_date)
|
|
|
|
| 38 |
raw_departure_city = parameters.get("departure_city")
|
| 39 |
raw_destination_city = parameters.get("destination_city")
|
| 40 |
raw_ticket_number = parameters.get("ticket_number")
|
|
|
|
| 215 |
"ticket_count": ticket_count,
|
| 216 |
"sort_by": ["price", "departure_time"]
|
| 217 |
}
|
| 218 |
+
print("I'm here")
|
| 219 |
try:
|
| 220 |
response = await api.post("/search/trips", payload=payload)
|
| 221 |
if response.get('status') == 200:
|
| 222 |
data = response["data"]["items"]
|
| 223 |
total = response["data"]["total"]
|
| 224 |
+
print(total)
|
| 225 |
if total > 0:
|
| 226 |
list_raw_departure_times = sorted(list(set([ trip["raw_departure_time"] for trip in data])))
|
| 227 |
schedule_time_trip = "**" + "** | **".join(map(str, list_raw_departure_times)) + "**"
|