From 63e1c29e52cdfe993de3597bbb2bb0661d31a680 Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Thu, 2 May 2024 18:05:40 +0200 Subject: [PATCH] Fixed edge case response --- src/endpoints/bettwaage.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/endpoints/bettwaage.py b/src/endpoints/bettwaage.py index cc319c5..a243b28 100644 --- a/src/endpoints/bettwaage.py +++ b/src/endpoints/bettwaage.py @@ -73,6 +73,8 @@ async def add_weight(tl: int, tr: int, bl: int, br: int): @router.post("/latest") async def get_latest(): + if not latest_values: + return HTMLResponse(status_code=200, content="No data given yet") total = sum(latest_values) return JSONResponse( {