Skip to content

Commit

Permalink
Only display pending trips as options to match
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybatt committed May 30, 2024
1 parent 0355bc8 commit 366f242
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/app/views/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ def post(self):
result = {"Trips": []}
for trip in trip.optional_trip_requests.split(",")[1:]:
trip_request_query = db.session.execute(db.select(TripRequest).filter_by(id=trip)).scalars().first()
result["Trips"].append(trip_request_query.to_dict())
if trip_request_query.status == "PENDING":
result["Trips"].append(trip_request_query.to_dict())
return make_response(result, 200)

return make_response({"error": "There is no Trip under this ID."}, 400)
Expand Down

0 comments on commit 366f242

Please sign in to comment.