feat(config): phase 7 — drop /ims basePath, update all hardcoded paths, refresh env spec

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 22:27:46 +08:00
co-authored by Claude Sonnet 4.6
parent d785d86636
commit 9d047e168f
18 changed files with 45 additions and 37 deletions
+4 -4
View File
@@ -28,7 +28,7 @@ export function ClosurePanel({ incidentId, status, canClose, canAddAddenda }: Pr
useEffect(() => {
if (!isClosed) return
fetch(`/ims/api/incidents/${incidentId}/addenda`)
fetch(`/api/incidents/${incidentId}/addenda`)
.then(r => (r.ok ? r.json() : Promise.reject()))
.then((data: Addendum[]) => setAddenda(Array.isArray(data) ? data : []))
.catch(() => {})
@@ -38,7 +38,7 @@ export function ClosurePanel({ incidentId, status, canClose, canAddAddenda }: Pr
if (!confirm('Close this incident? The record will be locked — only addenda can be added afterwards.')) return
setBusy(true)
setError(null)
const res = await fetch(`/ims/api/incidents/${incidentId}/close`, { method: 'POST' })
const res = await fetch(`/api/incidents/${incidentId}/close`, { method: 'POST' })
setBusy(false)
if (!res.ok) {
const data = await res.json().catch(() => ({}))
@@ -53,7 +53,7 @@ export function ClosurePanel({ incidentId, status, canClose, canAddAddenda }: Pr
if (!text) return
setBusy(true)
setError(null)
const res = await fetch(`/ims/api/incidents/${incidentId}/addenda`, {
const res = await fetch(`/api/incidents/${incidentId}/addenda`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ body: text }),
@@ -65,7 +65,7 @@ export function ClosurePanel({ incidentId, status, canClose, canAddAddenda }: Pr
return
}
setDraft('')
const list = await fetch(`/ims/api/incidents/${incidentId}/addenda`).then(r => r.json()).catch(() => [])
const list = await fetch(`/api/incidents/${incidentId}/addenda`).then(r => r.json()).catch(() => [])
setAddenda(Array.isArray(list) ? list : [])
}
+3 -3
View File
@@ -64,7 +64,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
async function getAiDraft() {
setAiDraftLoading(true)
try {
const res = await fetch(`/ims/api/incidents/${incidentId}/ai/rca-draft`, { method: 'POST' })
const res = await fetch(`/api/incidents/${incidentId}/ai/rca-draft`, { method: 'POST' })
if (!res.ok) return
const draft = await res.json() as {
five_why_steps: Array<{ why: string; answer: string }>
@@ -106,13 +106,13 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
let res: Response
if (existingInvestigationId) {
res = await fetch(`/ims/api/incidents/${incidentId}/investigation`, {
res = await fetch(`/api/incidents/${incidentId}/investigation`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...payload, investigation_id: existingInvestigationId, complete }),
})
} else {
res = await fetch(`/ims/api/incidents/${incidentId}/investigation`, {
res = await fetch(`/api/incidents/${incidentId}/investigation`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
@@ -31,7 +31,7 @@ export function SimilarIncidentsPanel({ incidentId }: Props) {
const [error, setError] = useState(false)
useEffect(() => {
fetch(`/ims/api/incidents/${incidentId}/similar`)
fetch(`/api/incidents/${incidentId}/similar`)
.then(r => {
if (!r.ok) throw new Error('failed')
return r.json()
+2 -2
View File
@@ -42,7 +42,7 @@ export function TriageForm({ incidentId, currentSeverity }: Props) {
setAiLoading(true)
setAiRationale(null)
try {
const res = await fetch(`/ims/api/incidents/${incidentId}/ai/triage-suggest`, { method: 'POST' })
const res = await fetch(`/api/incidents/${incidentId}/ai/triage-suggest`, { method: 'POST' })
if (!res.ok) return
const data = await res.json() as {
severity: number
@@ -69,7 +69,7 @@ export function TriageForm({ incidentId, currentSeverity }: Props) {
e.preventDefault()
setSaving(true)
setError(null)
const res = await fetch(`/ims/api/incidents/${incidentId}/triage`, {
const res = await fetch(`/api/incidents/${incidentId}/triage`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({