Add API_BASE to GameDevelopment.tsx

cgen-a3d33cb348664c18a9b29440d87f2c1b
This commit is contained in:
Builder.io 2025-11-13 03:00:02 +00:00
parent fa36c8b408
commit 7e21ba9226
3 changed files with 13 additions and 4 deletions

View file

@ -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<Studio[]>([]);
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);

View file

@ -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 }),

View file

@ -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({