completionId: cgen-3c5468b2a0ee4f0aadf3a3b008cadf2e

cgen-3c5468b2a0ee4f0aadf3a3b008cadf2e
This commit is contained in:
Builder.io 2025-11-15 16:28:35 +00:00
parent e9441535ae
commit e8bbedfc83

View file

@ -40,20 +40,41 @@ export default function GameForgeDashboard() {
const token = session?.access_token; const token = session?.access_token;
if (!token) throw new Error("No auth token"); if (!token) throw new Error("No auth token");
const sprintRes = await fetch(`${API_BASE}/api/gameforge/sprint`, { try {
headers: { Authorization: `Bearer ${token}` }, const sprintRes = await fetch(`${API_BASE}/api/gameforge/sprint`, {
}); headers: { Authorization: `Bearer ${token}` },
if (sprintRes.ok) setSprint(await sprintRes.json()); });
if (sprintRes.ok) {
const data = await sprintRes.json();
setSprint(data);
}
} catch (err) {
console.error("Failed to load sprint data:", err);
}
const teamRes = await fetch(`${API_BASE}/api/gameforge/team`, { try {
headers: { Authorization: `Bearer ${token}` }, const teamRes = await fetch(`${API_BASE}/api/gameforge/team`, {
}); headers: { Authorization: `Bearer ${token}` },
if (teamRes.ok) setTeam(await teamRes.json()); });
if (teamRes.ok) {
const data = await teamRes.json();
setTeam(Array.isArray(data) ? data : []);
}
} catch (err) {
console.error("Failed to load team data:", err);
}
const tasksRes = await fetch(`${API_BASE}/api/gameforge/tasks`, { try {
headers: { Authorization: `Bearer ${token}` }, const tasksRes = await fetch(`${API_BASE}/api/gameforge/tasks`, {
}); headers: { Authorization: `Bearer ${token}` },
if (tasksRes.ok) setTasks(await tasksRes.json()); });
if (tasksRes.ok) {
const data = await tasksRes.json();
setTasks(Array.isArray(data) ? data : []);
}
} catch (err) {
console.error("Failed to load tasks data:", err);
}
} catch (error) { } catch (error) {
console.error("Failed to load GAMEFORGE data", error); console.error("Failed to load GAMEFORGE data", error);
} finally { } finally {