fix: prefix all client-side fetch calls with /ims basePath
Client components were calling fetch('/api/...') without the /ims prefix,
causing 404s in production where Next.js serves under basePath: '/ims'.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFDuBhMKvoWjrWT3ZnGmmr
This commit is contained in:
@@ -98,7 +98,7 @@ export function ReportForm({ zoneToken }: Props) {
|
||||
|
||||
if (!overrideQuality) {
|
||||
try {
|
||||
const qcRes = await fetch('/api/incidents/ai/quality-check', {
|
||||
const qcRes = await fetch('/ims/api/incidents/ai/quality-check', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -136,7 +136,7 @@ export function ReportForm({ zoneToken }: Props) {
|
||||
}
|
||||
files.forEach(f => fd.append('files', f))
|
||||
|
||||
const res = await fetch('/api/incidents', { method: 'POST', body: fd })
|
||||
const res = await fetch('/ims/api/incidents', { method: 'POST', body: fd })
|
||||
const data = await res.json()
|
||||
|
||||
if (!res.ok) {
|
||||
|
||||
Reference in New Issue
Block a user