From 3ac5452a08f14cd8fce6763e0032d21b212ef2c4 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 3 Dec 2025 14:49:14 +0000 Subject: [PATCH] Fix dashboard route path from /dashboard/dashboard to /dashboard The dashboard router was mounted with prefix /dashboard and the HTML route was also /dashboard, making the full path /api/v1/dashboard/dashboard. Changed the route to / so it's accessible at /api/v1/dashboard. --- src/meshcore_hub/api/routes/dashboard.py | 2 +- tests/test_api/test_dashboard.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/meshcore_hub/api/routes/dashboard.py b/src/meshcore_hub/api/routes/dashboard.py index 24262f3..556ed88 100644 --- a/src/meshcore_hub/api/routes/dashboard.py +++ b/src/meshcore_hub/api/routes/dashboard.py @@ -77,7 +77,7 @@ async def get_stats( ) -@router.get("/dashboard", response_class=HTMLResponse) +@router.get("/", response_class=HTMLResponse) async def dashboard( request: Request, session: DbSession, diff --git a/tests/test_api/test_dashboard.py b/tests/test_api/test_dashboard.py index 0d5ff54..a9dec52 100644 --- a/tests/test_api/test_dashboard.py +++ b/tests/test_api/test_dashboard.py @@ -30,11 +30,11 @@ class TestDashboardStats: class TestDashboardHtml: - """Tests for GET /dashboard/dashboard endpoint.""" + """Tests for GET /dashboard endpoint.""" def test_dashboard_html_response(self, client_no_auth): """Test dashboard returns HTML.""" - response = client_no_auth.get("/api/v1/dashboard/dashboard") + response = client_no_auth.get("/api/v1/dashboard") assert response.status_code == 200 assert "text/html" in response.headers["content-type"] assert "" in response.text @@ -44,7 +44,7 @@ class TestDashboardHtml: self, client_no_auth, sample_node, sample_message ): """Test dashboard HTML contains stat values.""" - response = client_no_auth.get("/api/v1/dashboard/dashboard") + response = client_no_auth.get("/api/v1/dashboard") assert response.status_code == 200 # Check that stats are present assert "Total Nodes" in response.text @@ -53,7 +53,7 @@ class TestDashboardHtml: def test_dashboard_contains_recent_data(self, client_no_auth, sample_node): """Test dashboard HTML contains recent nodes.""" - response = client_no_auth.get("/api/v1/dashboard/dashboard") + response = client_no_auth.get("/api/v1/dashboard") assert response.status_code == 200 assert "Recent Nodes" in response.text # The node name should appear in the table