Fix add_point parameters
This commit is contained in:
parent
313a1ba43d
commit
701f5c7eeb
1 changed files with 3 additions and 2 deletions
|
@ -19,8 +19,9 @@ def list_points(name: str, access_token: APIKey = Depends(get_api_key)):
|
||||||
|
|
||||||
|
|
||||||
@router.get("/tracker/points/add")
|
@router.get("/tracker/points/add")
|
||||||
def add_point(name: str, value: int, date_str: str = datetime.now().isoformat(),
|
def add_point(name: str, value: int, date_str: str = None, access_token: APIKey = Depends(get_api_key)):
|
||||||
access_token: APIKey = Depends(get_api_key)):
|
if date_str is None:
|
||||||
|
date_str = datetime.now().isoformat()
|
||||||
try:
|
try:
|
||||||
tracker = Tracker.from_data(name)
|
tracker = Tracker.from_data(name)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue