Skip to content

Commit

Permalink
👽 updated api calls for /stats route
Browse files Browse the repository at this point in the history
  • Loading branch information
leehanchung committed Oct 10, 2020
1 parent 7e27e87 commit ac86bd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/utils/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def get_daily_stats() -> Dict:
data = requests.get(url=app_config.CVTRACK_URL).json()
curr = data[0]
prev = data[1]
tested = curr["posNeg"]
# 2020-10-10 updated for new api schema
tested = curr["totalTestResults"]
todays_tested = curr["totalTestResults"] - prev["totalTestResults"]
confirmed = curr["positive"]
todays_confirmed = curr["positive"] - prev["positive"]
Expand All @@ -68,6 +69,7 @@ def get_daily_stats() -> Dict:
"deaths": deaths,
"todays_deaths": todays_deaths,
}
print(stats)

###################################################################
# Sanity Check
Expand Down

0 comments on commit ac86bd6

Please sign in to comment.