frontend: scenario create + delete (CRUD loop closes)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was canceled
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was canceled
/scenarios/new — form posts to POST /scenarios with name, description,
jurisdiction, strategy, glide path, leave-UK year, spending, NW seed,
savings, horizon. Required-name validation; on success invalidates the
scenarios query and navigates to the new detail page.
/scenarios/:id — Delete button (user scenarios only; cartesian are
backend-protected). Browser confirm prompt + DELETE /scenarios/{id} +
invalidate + redirect to list.
api.scenarios gains create() and delete(). New ScenarioCreateBody type.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
d2fd765fe0
commit
60c275cd05
5 changed files with 305 additions and 10 deletions
|
|
@ -4,6 +4,7 @@ import { NavLink, Route, Routes, Link } from 'react-router-dom';
|
|||
import { api } from '@/api/client';
|
||||
import { Dashboard } from '@/pages/Dashboard';
|
||||
import { ScenarioDetail } from '@/pages/ScenarioDetail';
|
||||
import { ScenarioNew } from '@/pages/ScenarioNew';
|
||||
import { Scenarios } from '@/pages/Scenarios';
|
||||
import { WhatIf } from '@/pages/WhatIf';
|
||||
|
||||
|
|
@ -40,6 +41,7 @@ export function App() {
|
|||
<Routes>
|
||||
<Route path="/" element={<Dashboard />} />
|
||||
<Route path="/scenarios" element={<Scenarios />} />
|
||||
<Route path="/scenarios/new" element={<ScenarioNew />} />
|
||||
<Route path="/scenarios/:id" element={<ScenarioDetail />} />
|
||||
<Route path="/what-if" element={<WhatIf />} />
|
||||
</Routes>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue