Skip to content

Commit 20c49c2

Browse files
committed
get location by id
1 parent e31aad6 commit 20c49c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def get_all_locations(country_code: str = None, timelines: int = 0):
129129

130130

131131
@APP.get("/locations/{id}", response_model=Location)
132-
def get_location_by_id(id: int):
133-
return
132+
def get_location_by_id(request: fastapi.Request, id: int, timelines: int = 1):
133+
return {"location": request.state.source.get(id).serialize(timelines)}
134134

135135

136136
if __name__ == "__main__":

0 commit comments

Comments
 (0)