diff --git a/routers/web_routes.py b/routers/web_routes.py index d72763f..c5c0e26 100644 --- a/routers/web_routes.py +++ b/routers/web_routes.py @@ -34,7 +34,8 @@ async def admin_page(request: Request): "config_days": config['processing']['days_to_show'] }) -@router.get("/cache-clear") -async def clear_cache(): +@router.get("/cache-clear", name="clear_cache") +async def clear_cache(request: Request): invalidate_cache() - return RedirectResponse(url="/") \ No newline at end of file + # Nutzt url_for, um den Redirect-Pfad inkl. root_path zu generieren + return RedirectResponse(url=request.url_for("admin_page")) \ No newline at end of file