fix(v2): version display — correct URL path (/api/api-version)

apiFetch adds /api prefix, so /api-version became /api/api-version
which was wrong. Use raw fetch with correct path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-04-13 13:30:04 +02:00
parent a59296867d
commit 6b0b26c287
4 changed files with 9 additions and 8 deletions

View file

@ -29,7 +29,8 @@ export const MapLayout: React.FC<Props> = ({ data, onViewToggle }) => {
const [version, setVersion] = useState('');
useEffect(() => {
apiFetch<{ version: string }>('/api-version').then(d => setVersion(d.version ?? '')).catch(() => {});
// /api-version is the actual route — apiFetch adds /api prefix, so use raw fetch
fetch('/api/api-version', { credentials: 'include' }).then(r => r.json()).then(d => setVersion(d.version ?? '')).catch(() => {});
}, []);
const handleSelectPlayer = useCallback((name: string) => {