- New users table (migration 004) with user_id on exercises, training_sets, sessions
- User CRUD endpoints (GET/POST /api/v1/users, DELETE /api/v1/users/{id})
- All existing endpoints scoped to X-User-ID header
- CSV export endpoint (GET /api/v1/export) for completed sessions
- UserGate in PageShell: blocks app until a user is selected
- Settings page for managing users (create, switch, delete)
- BottomNav/Sidebar updated with settings navigation
- Fix: nil pointer panic in handleDeleteUser on success path
- Fix: export download now uses fetch with X-User-ID header instead of window.location.href
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
825 B
TypeScript
Executable File
25 lines
825 B
TypeScript
Executable File
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
import { PageShell } from './components/layout/PageShell';
|
|
import { ExercisesPage } from './pages/ExercisesPage';
|
|
import { SetsPage } from './pages/SetsPage';
|
|
import { TrainingPage } from './pages/TrainingPage';
|
|
import { HistoryPage } from './pages/HistoryPage';
|
|
import { SettingsPage } from './pages/SettingsPage';
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
element: <PageShell />,
|
|
children: [
|
|
{ path: '/', element: <ExercisesPage /> },
|
|
{ path: '/sets', element: <SetsPage /> },
|
|
{ path: '/training', element: <TrainingPage /> },
|
|
{ path: '/history', element: <HistoryPage /> },
|
|
{ path: '/settings', element: <SettingsPage /> },
|
|
],
|
|
},
|
|
]);
|
|
|
|
export function App() {
|
|
return <RouterProvider router={router} />;
|
|
}
|