Add API_BASE to GameDevelopment.tsx
cgen-a3d33cb348664c18a9b29440d87f2c1b
This commit is contained in:
parent
fa36c8b408
commit
7e21ba9226
3 changed files with 13 additions and 4 deletions
|
|
@ -1,4 +1,7 @@
|
||||||
import { useState, useEffect, useRef } from "react";
|
import { useState, useEffect, useRef } from "react";
|
||||||
|
|
||||||
|
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||||
|
|
||||||
import Layout from "@/components/Layout";
|
import Layout from "@/components/Layout";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
import {
|
||||||
|
|
@ -182,7 +185,7 @@ export default function GameDevelopment() {
|
||||||
|
|
||||||
const [studios, setStudios] = useState<Studio[]>([]);
|
const [studios, setStudios] = useState<Studio[]>([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch("/api/featured-studios")
|
fetch(`${API_BASE}/api/featured-studios`)
|
||||||
.then((r) => (r.ok ? r.json() : []))
|
.then((r) => (r.ok ? r.json() : []))
|
||||||
.then((data) => (Array.isArray(data) ? setStudios(data) : undefined))
|
.then((data) => (Array.isArray(data) ? setStudios(data) : undefined))
|
||||||
.catch(() => undefined);
|
.catch(() => undefined);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
import Layout from "@/components/Layout";
|
import Layout from "@/components/Layout";
|
||||||
|
|
||||||
|
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||||
|
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
|
|
@ -51,7 +54,7 @@ export default function Investors() {
|
||||||
}
|
}
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
try {
|
try {
|
||||||
const resp = await fetch("/api/investors/interest", {
|
const resp = await fetch(`${API_BASE}/api/investors/interest`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ name, email, amount, accredited, message }),
|
body: JSON.stringify({ name, email, amount, accredited, message }),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
|
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||||
|
|
||||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||||
import LoadingScreen from "@/components/LoadingScreen";
|
import LoadingScreen from "@/components/LoadingScreen";
|
||||||
import { useAuth } from "@/contexts/AuthContext";
|
import { useAuth } from "@/contexts/AuthContext";
|
||||||
|
|
@ -37,7 +40,7 @@ export default function RobloxCallback() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exchange code for Roblox user info via backend
|
// 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",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ code, state }),
|
body: JSON.stringify({ code, state }),
|
||||||
|
|
@ -58,7 +61,7 @@ export default function RobloxCallback() {
|
||||||
|
|
||||||
// If user is already authenticated, link the Roblox account
|
// If user is already authenticated, link the Roblox account
|
||||||
if (user && data.roblox_user_id) {
|
if (user && data.roblox_user_id) {
|
||||||
await fetch("/api/user/link-roblox", {
|
await fetch(`${API_BASE}/api/user/link-roblox`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue