Skip to content

Commit

Permalink
update Sources enum
Browse files Browse the repository at this point in the history
* linting fix (invalid-name)
* use Sources enum instead of string
  • Loading branch information
Kilo59 committed Feb 27, 2021
1 parent bdc7843 commit 16e9bcd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/routers/v2.py
Expand Up @@ -14,13 +14,13 @@ class Sources(str, enum.Enum):
A source available for retrieving data.
"""

jhu = "jhu"
csbs = "csbs"
nyt = "nyt"
JHU = "jhu"
CSBS = "csbs"
NYT = "nyt"


@V2.get("/latest", response_model=LatestResponse)
async def get_latest(request: Request, source: Sources = "jhu"): # pylint: disable=unused-argument
async def get_latest(request: Request, source: Sources = Sources.JHU): # pylint: disable=unused-argument
"""
Getting latest amount of total confirmed cases, deaths, and recoveries.
"""
Expand Down Expand Up @@ -91,7 +91,7 @@ async def get_locations(
# pylint: disable=invalid-name
@V2.get("/locations/{id}", response_model=LocationResponse)
async def get_location_by_id(
request: Request, id: int, source: Sources = "jhu", timelines: bool = True
request: Request, id: int, source: Sources = Sources.JHU, timelines: bool = True
):
"""
Getting specific location by id.
Expand Down

0 comments on commit 16e9bcd

Please sign in to comment.