completionId: cgen-f6066627f86e4450850350c690fd10f1

cgen-f6066627f86e4450850350c690fd10f1
This commit is contained in:
Builder.io 2025-11-15 17:03:51 +00:00
parent ddedebdb85
commit 9fa1d58eb0

View file

@ -104,6 +104,25 @@ export default function GameForgeDashboard() {
} catch (err) {
// Silently ignore API errors
}
try {
const projectsRes = await fetch(`${API_BASE}/api/gameforge/projects`, {
headers: { Authorization: `Bearer ${token}` },
});
if (
projectsRes.ok &&
projectsRes.headers.get("content-type")?.includes("application/json")
) {
const data = await projectsRes.json();
setProjects(Array.isArray(data) ? data : []);
// Check if user is a project lead
if (data && data.some((p: any) => p.lead_id === user?.id)) {
setIsProjectLead(true);
}
}
} catch (err) {
// Silently ignore API errors
}
} catch (error) {
// Silently ignore errors
} finally {