Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
backend: add description to routes response
Browse files Browse the repository at this point in the history
  • Loading branch information
OxygenCobalt committed Mar 24, 2024
1 parent 317983c commit 10d4a85
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions backend/src/handlers/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
FIELD_IS_ACTIVE = "isActive"
FIELD_LATITUDE = "latitude"
FIELD_LONGITUDE = "longitude"
FIELD_DESCRIPTION = "description"
INCLUDES = {
FIELD_STOP_IDS,
FIELD_WAYPOINTS,
Expand Down Expand Up @@ -64,7 +65,11 @@ def get_routes(

routes_json = []
for route in routes:
route_json = {FIELD_ID: route.id, FIELD_NAME: route.name}
route_json = {
FIELD_ID: route.id,
FIELD_NAME: route.name,
FIELD_DESCRIPTION: route.description,
}

# Add related values to the route if included
if FIELD_STOP_IDS in include_set:
Expand Down Expand Up @@ -204,7 +209,11 @@ def get_route(
if not route:
raise HTTPException(status_code=404, detail="Route not found")

route_json = {FIELD_ID: route.id, FIELD_NAME: route.name}
route_json = {
FIELD_ID: route.id,
FIELD_NAME: route.name,
FIELD_DESCRIPTION: route.description,
}

# Add related values to the route if included
if FIELD_STOP_IDS in include_set:
Expand Down

0 comments on commit 10d4a85

Please sign in to comment.