fix: remove harcoded api url
All checks were successful
Bump Dependencies / update-dependencies (push) Successful in 1m8s
Build and Push Nightly CI Image / build_and_push (push) Successful in 1m58s
Build and Push Docker Image / build_and_push (push) Successful in 4s
All checks were successful
Bump Dependencies / update-dependencies (push) Successful in 1m8s
Build and Push Nightly CI Image / build_and_push (push) Successful in 1m58s
Build and Push Docker Image / build_and_push (push) Successful in 4s
This commit is contained in:
parent
6efc4a2b32
commit
ddf16ef013
@ -22,8 +22,6 @@ export default function Dashboard() {
|
|||||||
gitFollowingCt: 0,
|
gitFollowingCt: 0,
|
||||||
gitAvatar: "",
|
gitAvatar: "",
|
||||||
gitLastLogin: "",
|
gitLastLogin: "",
|
||||||
gitProfileCardLoading: true,
|
|
||||||
gitProfileCardError: false,
|
|
||||||
gitIsAdmin: false,
|
gitIsAdmin: false,
|
||||||
gitEmail: "",
|
gitEmail: "",
|
||||||
showRunSecurityCheckBtn: true,
|
showRunSecurityCheckBtn: true,
|
||||||
@ -33,7 +31,7 @@ export default function Dashboard() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const checkGitLinkStatus = async () => {
|
const checkGitLinkStatus = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch("http://localhost:3000/api/git/user")
|
const response = await fetch("/api/git/user")
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
@ -46,18 +44,12 @@ export default function Dashboard() {
|
|||||||
gitFollowingCt: data.following_count || 0,
|
gitFollowingCt: data.following_count || 0,
|
||||||
gitIsAdmin: data.is_admin || false,
|
gitIsAdmin: data.is_admin || false,
|
||||||
gitEmail: data.email || "",
|
gitEmail: data.email || "",
|
||||||
gitProfileCardLoading: false,
|
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Failed to fetch Gitea account details");
|
throw new Error("Failed to fetch Gitea account details");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching your Gitea user data:", error);
|
console.error("Error fetching your Gitea user data:", error);
|
||||||
setDashboardState((prev) => ({
|
|
||||||
...prev,
|
|
||||||
gitProfileCardError: true,
|
|
||||||
gitProfileCardLoading: false,
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user