Skip to content

Commit

Permalink
Update policy with default.
Browse files Browse the repository at this point in the history
  • Loading branch information
sven4all committed May 13, 2024
1 parent d8add35 commit e3c7d25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,4 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

backup/
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def delete_zones_route(delete_request: delete_zone.DeleteZonesRequest, current_u
def get_zones_private(
municipality: Union[str, None] = None,
geography_types: list[zone.GeographyType] = Query(default=[]),
phases: Annotated[list[zone.Phase], Query()] = []):
phases: Annotated[list[zone.Phase], Query()] = [zone.Phase.active, zone.Phase.retirement_concept, zone.Phase.published_retirement, zone.Phase.committed_retire_concept]):
if len(phases) == 0:
raise HTTPException(status_code=400, detail="At least one phase in query parameter phases should be specified.")
return get_zones.get_private_zones(municipality=municipality, geography_types=geography_types, phases=phases)
Expand All @@ -69,7 +69,7 @@ def get_zones_private(
def get_zones_public(
municipality: Union[str, None] = None,
geography_types: list[zone.GeographyType] = Query(default=[]),
phases: Annotated[list[zone.Phase], Query()] = []):
phases: Annotated[list[zone.Phase], Query()] = [zone.Phase.active, zone.Phase.retirement_concept, zone.Phase.published_retirement, zone.Phase.committed_retire_concept]):
return get_zones.get_public_zones(municipality=municipality, geography_types=geography_types, phases=phases)

@app.get("/public/service_area")
Expand Down

0 comments on commit e3c7d25

Please sign in to comment.