Add API_BASE and fix relative URLs in AdminGameForgeStudio.tsx

cgen-c1cd45a730d442f1955d8bb76a7261e6
This commit is contained in:
Builder.io 2025-11-13 02:56:31 +00:00
parent 5708d5a1af
commit df05686180

View file

@ -1,4 +1,6 @@
import { useEffect, useState } from "react";
const API_BASE = import.meta.env.VITE_API_BASE || "";
import {
Card,
CardContent,
@ -97,7 +99,7 @@ export default function AdminGameForgeStudio() {
setLoading(true);
// Fetch projects
const projectsRes = await fetch("/api/gameforge/projects");
const projectsRes = await fetch(`${API_BASE}/api/gameforge/projects`);
if (projectsRes.ok) {
const { data } = await projectsRes.json();
setProjects(data || []);
@ -107,7 +109,7 @@ export default function AdminGameForgeStudio() {
}
// Fetch team members
const teamRes = await fetch("/api/gameforge/team");
const teamRes = await fetch(`${API_BASE}/api/gameforge/team`);
if (teamRes.ok) {
const { data } = await teamRes.json();
setTeamMembers(data || []);