completionId: cgen-f6066627f86e4450850350c690fd10f1
cgen-f6066627f86e4450850350c690fd10f1
This commit is contained in:
parent
ddedebdb85
commit
9fa1d58eb0
1 changed files with 19 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue