Fixed edge case response

This commit is contained in:
Maximilian Giller 2024-05-02 18:05:40 +02:00
parent dd3264365c
commit 63e1c29e52

View file

@ -73,6 +73,8 @@ async def add_weight(tl: int, tr: int, bl: int, br: int):
@router.post("/latest") @router.post("/latest")
async def get_latest(): async def get_latest():
if not latest_values:
return HTMLResponse(status_code=200, content="No data given yet")
total = sum(latest_values) total = sum(latest_values)
return JSONResponse( return JSONResponse(
{ {