hot fix #3 dev day #70

This commit is contained in:
Tomas Dvorak
2025-10-24 18:15:36 +02:00
parent 80f833b926
commit 36f0f454ce
42 changed files with 124 additions and 127 deletions
@@ -46,6 +46,7 @@ import { useSearchParams } from 'react-router-dom';
import { parse } from 'date-fns';
import { assetUrl } from '../../utils/url';
import { batchFetchLogosFromSportLogosAPI } from '../../utils/sportLogosAPI';
import { API_URL } from '../../services/api';
const MatchesAdminPage = () => {
const queryClient = useQueryClient();
@@ -155,8 +156,7 @@ const MatchesAdminPage = () => {
queryKey: ['admin-matches-list-cache'],
queryFn: async () => {
// Read cached FACR club info
const apiUrl = process.env.REACT_APP_API_URL || 'http://localhost:8080/api/v1';
const origin = new URL(apiUrl).origin;
const origin = new URL(API_URL, typeof window !== 'undefined' ? window.location.origin : 'http://localhost:3000').origin;
const url = `${origin}/cache/prefetch/facr_club_info.json`;
const res = await fetch(url, { headers: { 'Cache-Control': 'no-cache' } });
if (!res.ok) throw new Error(`Failed to load cache: ${res.status}`);
@@ -225,8 +225,7 @@ const MatchesAdminPage = () => {
const { data: facrClubInfo } = useQuery({
queryKey: ['facr-club-info-name'],
queryFn: async () => {
const apiUrl = process.env.REACT_APP_API_URL || 'http://localhost:8080/api/v1';
const origin = new URL(apiUrl).origin;
const origin = new URL(API_URL, typeof window !== 'undefined' ? window.location.origin : 'http://localhost:3000').origin;
const url = `${origin}/cache/prefetch/facr_club_info.json`;
const res = await fetch(url, { headers: { 'Cache-Control': 'no-cache' } });
if (!res.ok) return null;