From 9fa1d58eb007a32ea0f65fa4fb24a49f653599cf Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 15 Nov 2025 17:03:51 +0000 Subject: [PATCH] completionId: cgen-f6066627f86e4450850350c690fd10f1 cgen-f6066627f86e4450850350c690fd10f1 --- .../pages/dashboards/GameForgeDashboard.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/client/pages/dashboards/GameForgeDashboard.tsx b/client/pages/dashboards/GameForgeDashboard.tsx index 2a6a63b6..7810c273 100644 --- a/client/pages/dashboards/GameForgeDashboard.tsx +++ b/client/pages/dashboards/GameForgeDashboard.tsx @@ -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 {