OnlyBiggg commited on
Commit
57dd5c9
·
1 Parent(s): cb410be
Files changed (1) hide show
  1. app/api/routes.py +2 -3
app/api/routes.py CHANGED
@@ -224,10 +224,9 @@ async def booking_trip(request: Request) -> Response:
224
  trips = []
225
  routes_name = []
226
  for trip in data:
227
- if trip["route"] and trip["route"]["name"] not in routes_name:
 
228
  routes_name.append(f"{trip['route']['origin_hub_name']} => {trip['route']['dest_hub_name']}")
229
-
230
- print(f"{trip['route']['origin_hub_name']} => {trip['route']['dest_hub_name']}")
231
  trips.append({
232
  "route_name": f"{trip['route']['origin_hub_name']} => {trip['route']['dest_hub_name']}",
233
  "route_id": trip["route_id"],
 
224
  trips = []
225
  routes_name = []
226
  for trip in data:
227
+ route = f"{trip['route']['origin_hub_name']} => {trip['route']['dest_hub_name']}"
228
+ if trip["route"] and route not in routes_name:
229
  routes_name.append(f"{trip['route']['origin_hub_name']} => {trip['route']['dest_hub_name']}")
 
 
230
  trips.append({
231
  "route_name": f"{trip['route']['origin_hub_name']} => {trip['route']['dest_hub_name']}",
232
  "route_id": trip["route_id"],