From 7e21ba9226ea060e0d7a4ecaa4f6819c43fbfea4 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Thu, 13 Nov 2025 03:00:02 +0000 Subject: [PATCH] Add API_BASE to GameDevelopment.tsx cgen-a3d33cb348664c18a9b29440d87f2c1b --- client/pages/GameDevelopment.tsx | 5 ++++- client/pages/Investors.tsx | 5 ++++- client/pages/RobloxCallback.tsx | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/client/pages/GameDevelopment.tsx b/client/pages/GameDevelopment.tsx index 33a270c1..0fddad80 100644 --- a/client/pages/GameDevelopment.tsx +++ b/client/pages/GameDevelopment.tsx @@ -1,4 +1,7 @@ import { useState, useEffect, useRef } from "react"; + +const API_BASE = import.meta.env.VITE_API_BASE || ""; + import Layout from "@/components/Layout"; import { Button } from "@/components/ui/button"; import { @@ -182,7 +185,7 @@ export default function GameDevelopment() { const [studios, setStudios] = useState([]); useEffect(() => { - fetch("/api/featured-studios") + fetch(`${API_BASE}/api/featured-studios`) .then((r) => (r.ok ? r.json() : [])) .then((data) => (Array.isArray(data) ? setStudios(data) : undefined)) .catch(() => undefined); diff --git a/client/pages/Investors.tsx b/client/pages/Investors.tsx index a15d1810..b9009d78 100644 --- a/client/pages/Investors.tsx +++ b/client/pages/Investors.tsx @@ -1,4 +1,7 @@ import Layout from "@/components/Layout"; + +const API_BASE = import.meta.env.VITE_API_BASE || ""; + import { Button } from "@/components/ui/button"; import { Card, @@ -51,7 +54,7 @@ export default function Investors() { } setSubmitting(true); try { - const resp = await fetch("/api/investors/interest", { + const resp = await fetch(`${API_BASE}/api/investors/interest`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name, email, amount, accredited, message }), diff --git a/client/pages/RobloxCallback.tsx b/client/pages/RobloxCallback.tsx index 6ab235ef..b6e9ce6a 100644 --- a/client/pages/RobloxCallback.tsx +++ b/client/pages/RobloxCallback.tsx @@ -1,4 +1,7 @@ import { useEffect } from "react"; + +const API_BASE = import.meta.env.VITE_API_BASE || ""; + import { useNavigate, useSearchParams } from "react-router-dom"; import LoadingScreen from "@/components/LoadingScreen"; import { useAuth } from "@/contexts/AuthContext"; @@ -37,7 +40,7 @@ export default function RobloxCallback() { } // Exchange code for Roblox user info via backend - const response = await fetch("/api/roblox/oauth/callback", { + const response = await fetch(`${API_BASE}/api/roblox/oauth/callback`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ code, state }), @@ -58,7 +61,7 @@ export default function RobloxCallback() { // If user is already authenticated, link the Roblox account if (user && data.roblox_user_id) { - await fetch("/api/user/link-roblox", { + await fetch(`${API_BASE}/api/user/link-roblox`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({