Spaces:
Sleeping
Sleeping
OnlyBiggg commited on
Commit ·
3804450
1
Parent(s): b2c9d4f
fix trip list
Browse files
app/dialogflow/api/v1/dialogflow.py
CHANGED
|
@@ -314,6 +314,7 @@ async def get_trip_list(request: Request) -> Response:
|
|
| 314 |
if trip_by_time_office:
|
| 315 |
parameters = {
|
| 316 |
"is_valid_trip": True,
|
|
|
|
| 317 |
}
|
| 318 |
return DialogFlowResponseAPI(parameters=parameters)
|
| 319 |
|
|
@@ -328,7 +329,7 @@ async def get_trip_list(request: Request) -> Response:
|
|
| 328 |
for trip in trip_surrounding_time:
|
| 329 |
if ticket_count <= trip["empty_seat_quantity"]:
|
| 330 |
trip_dialogflow.append({"trip_id": trip["id"], "route":f'{trip["raw_departure_time"]} | {trip["route"]["origin_hub_name"]} => {trip["route"]["dest_hub_name"]}'})
|
| 331 |
-
text = ["Quý khách vui lòng lựa chọn chuyến xe\n" + "\n".join(f
|
| 332 |
payload={
|
| 333 |
"richContent": [
|
| 334 |
[
|
|
|
|
| 314 |
if trip_by_time_office:
|
| 315 |
parameters = {
|
| 316 |
"is_valid_trip": True,
|
| 317 |
+
"trip": trip_by_time_office
|
| 318 |
}
|
| 319 |
return DialogFlowResponseAPI(parameters=parameters)
|
| 320 |
|
|
|
|
| 329 |
for trip in trip_surrounding_time:
|
| 330 |
if ticket_count <= trip["empty_seat_quantity"]:
|
| 331 |
trip_dialogflow.append({"trip_id": trip["id"], "route":f'{trip["raw_departure_time"]} | {trip["route"]["origin_hub_name"]} => {trip["route"]["dest_hub_name"]}'})
|
| 332 |
+
text = ["Quý khách vui lòng lựa chọn chuyến xe\n" + "\n".join(f'{i+1}. {trip["route"]}' for i, trip in enumerate(trip_dialogflow))]
|
| 333 |
payload={
|
| 334 |
"richContent": [
|
| 335 |
[
|