hot fix #5 dev day #70

This commit is contained in:
Tomas Dvorak
2025-10-24 23:21:57 +02:00
parent b8839fc1ff
commit 81389c108f
13 changed files with 45 additions and 37 deletions
+4 -4
View File
@@ -8,6 +8,7 @@ import ClubModal from '../components/home/ClubModal';
import { usePublicSettings } from '../hooks/usePublicSettings';
import { sortCategoriesWithOrder } from '../utils/categorySort';
import { TeamLogo } from '../components/common/TeamLogo';
import { API_URL } from '../services/api';
type TableRow = {
rank: string;
@@ -34,10 +35,9 @@ const resolveBackendUrl = (path: string) => {
try {
if (/^https?:\/\//i.test(path)) return path;
if (path.startsWith('/cache') || path.startsWith('/uploads')) {
const base = process.env.REACT_APP_API_BASE_URL || process.env.REACT_APP_API_URL || 'http://localhost:8080/api/v1';
const u = new URL(base);
u.pathname = path;
return u.toString();
const u = new URL(API_URL, typeof window !== 'undefined' ? window.location.origin : undefined);
const abs = new URL(path, `${u.protocol}//${u.host}`);
return abs.toString();
}
return path;
} catch {