From ddf16ef01387849d58c9d4eaf5df72b8e2da6640 Mon Sep 17 00:00:00 2001 From: Aidan Date: Thu, 20 Feb 2025 22:48:41 -0500 Subject: [PATCH] fix: remove harcoded api url --- app/account/dashboard/page.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/account/dashboard/page.tsx b/app/account/dashboard/page.tsx index 8e5889b..037c35d 100644 --- a/app/account/dashboard/page.tsx +++ b/app/account/dashboard/page.tsx @@ -22,8 +22,6 @@ export default function Dashboard() { gitFollowingCt: 0, gitAvatar: "", gitLastLogin: "", - gitProfileCardLoading: true, - gitProfileCardError: false, gitIsAdmin: false, gitEmail: "", showRunSecurityCheckBtn: true, @@ -33,7 +31,7 @@ export default function Dashboard() { useEffect(() => { const checkGitLinkStatus = async () => { try { - const response = await fetch("http://localhost:3000/api/git/user") + const response = await fetch("/api/git/user") if (response.ok) { const data = await response.json() @@ -46,18 +44,12 @@ export default function Dashboard() { gitFollowingCt: data.following_count || 0, gitIsAdmin: data.is_admin || false, gitEmail: data.email || "", - gitProfileCardLoading: false, })) } else { throw new Error("Failed to fetch Gitea account details"); } } catch (error) { console.error("Error fetching your Gitea user data:", error); - setDashboardState((prev) => ({ - ...prev, - gitProfileCardError: true, - gitProfileCardLoading: false, - })) } }