ugh
This commit is contained in:
@@ -14,6 +14,8 @@ export interface PlatformStats {
|
||||
export async function fetchPlatformStats(): Promise<PlatformStats> {
|
||||
const BASE_API_URL = process.env.SERVER_API_URL || 'http://localhost:3001/api';
|
||||
|
||||
console.log('Fetching platform stats from:', BASE_API_URL);
|
||||
|
||||
try {
|
||||
const response = await fetch(`${BASE_API_URL}/stats/platform`, {
|
||||
method: 'GET',
|
||||
@@ -27,7 +29,9 @@ export async function fetchPlatformStats(): Promise<PlatformStats> {
|
||||
throw new Error(`API error: ${response.status}`);
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
const data = await response.json();
|
||||
console.log('Fetched stats:', data);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching platform stats:', error);
|
||||
// Return fallback data if API fails
|
||||
|
||||
Reference in New Issue
Block a user