From a71ad8cf3ea53ca6a313ea7e387666ca11f25a2f Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 15 Nov 2025 16:31:38 +0000 Subject: [PATCH] completionId: cgen-ff03c07ab89b48d69025a26448158af4 cgen-ff03c07ab89b48d69025a26448158af4 --- client/pages/dashboards/FoundationDashboard.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/pages/dashboards/FoundationDashboard.tsx b/client/pages/dashboards/FoundationDashboard.tsx index 6bf405da..c9401c50 100644 --- a/client/pages/dashboards/FoundationDashboard.tsx +++ b/client/pages/dashboards/FoundationDashboard.tsx @@ -62,27 +62,27 @@ export default function FoundationDashboard() { const coursesRes = await fetch(`${API_BASE}/api/foundation/courses`, { headers: { Authorization: `Bearer ${token}` }, }); - if (coursesRes.ok) { + if (coursesRes.ok && coursesRes.headers.get("content-type")?.includes("application/json")) { const data = await coursesRes.json(); setCourses(Array.isArray(data) ? data : []); } } catch (err: any) { - console.error("Failed to load courses:", err); + // Silently ignore API errors - dashboard will render with empty data } try { const mentorRes = await fetch(`${API_BASE}/api/foundation/mentorships`, { headers: { Authorization: `Bearer ${token}` }, }); - if (mentorRes.ok) { + if (mentorRes.ok && mentorRes.headers.get("content-type")?.includes("application/json")) { const data = await mentorRes.json(); setMentorships(data.as_mentee || []); } } catch (err: any) { - console.error("Failed to load mentorships:", err); + // Silently ignore API errors - dashboard will render with empty data } } catch (error: any) { - console.error("Failed to load dashboard data", error); + // Silently ignore errors } finally { setLoading(false); }