Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def dispatch(self, request: Request, call_next):
allow_origins=ALLOWED_ORIGINS,
allow_origin_regex=ALLOW_ORIGIN_REGEX or None,
allow_credentials=True,
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allow_methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
allow_headers=["Authorization", "Content-Type"],
)

Expand Down
13 changes: 13 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { APIOverviewPage, APIRepositoriesPage, APISearchPage, APIAnalysisPage }
import { ArchitecturePage } from './pages/ArchitecturePage';
import { ContributingPage } from './pages/ContributingPage';
import { GitHubCallbackPage } from './pages/GitHubCallbackPage';
import { AdminPage } from './pages/AdminPage';
import { ScrollToTop } from './components/ScrollToTop';
import { ErrorBoundary } from './components/ErrorBoundary';

Expand Down Expand Up @@ -110,6 +111,18 @@ function AppRoutes() {
/>


{/* Admin -- standalone route, no dashboard layout */}
<Route
path="/admin"
element={
<ProtectedRoute>
<div className="min-h-screen bg-background p-8 max-w-6xl mx-auto">
<AdminPage />
</div>
</ProtectedRoute>
}
/>

{/* Fallback */}
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import { Routes, Route, Navigate } from 'react-router-dom'
import { DashboardLayout } from './dashboard/DashboardLayout'
import { DashboardHome } from './dashboard/DashboardHome'
import { SettingsPage } from '../pages/SettingsPage'
import { AdminPage } from '../pages/AdminPage'

export function Dashboard() {
return (
<DashboardLayout>
<Routes>
<Route index element={<DashboardHome />} />
<Route path="settings" element={<SettingsPage />} />
<Route path="admin" element={<AdminPage />} />
<Route path="*" element={<Navigate to="/dashboard" replace />} />
</Routes>
</DashboardLayout>
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/dashboard/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Link, useLocation } from 'react-router-dom'
import {
FolderGit2,
BookOpen,
Shield,
ChevronLeft,
ChevronRight,
ExternalLink,
Expand All @@ -25,7 +24,6 @@ interface NavItem {

const mainNavItems: NavItem[] = [
{ name: 'Repositories', href: '/dashboard', icon: <FolderGit2 className="w-5 h-5" /> },
{ name: 'Admin', href: '/dashboard/admin', icon: <Shield className="w-5 h-5" /> },
]

const bottomNavItems: NavItem[] = [
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/AdminPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function AdminPage() {
return resp.json()
},
enabled: !!session?.access_token,
retry: false,
})

const users = data?.users ?? []
Expand Down