From 45a6e7233654591d3a9a919cbb67eeb4fc477be9 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Mon, 27 Jul 2026 03:36:13 +0530 Subject: [PATCH] fix: template literal interpolation in github.ts and InteractiveBackground.tsx - Fixed 4 GitHub API URLs using single quotes instead of backticks in github.ts causing runtime failures when fetching user profile, repos, and contributor stats - Fixed not being interpolated in InteractiveBackground.tsx causing the literal string to be displayed instead of the actual API URL --- src/components/ui/InteractiveBackground.tsx | 2 +- src/lib/github.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/ui/InteractiveBackground.tsx b/src/components/ui/InteractiveBackground.tsx index b1c16f35..f68fb937 100644 --- a/src/components/ui/InteractiveBackground.tsx +++ b/src/components/ui/InteractiveBackground.tsx @@ -56,7 +56,7 @@ const CODE_LINES = [ 'pip install knowledge', 'docker build -t devpath .', 'kubectl apply -f community.yaml', - 'curl -X POST ${DEVPATH_API}/join', + `curl -X POST ${DEVPATH_API}/join`, 'chmod +x ./your_potential.sh', './launch_career.sh --mode=open-source', diff --git a/src/lib/github.ts b/src/lib/github.ts index 0bcac512..35a3ecd1 100644 --- a/src/lib/github.ts +++ b/src/lib/github.ts @@ -5,7 +5,7 @@ const DEVPATH_REPO = 'devpathindcommunity-india/DevPath-Web'; const PER_PAGE = process.env.NEXT_PUBLIC_GITHUB_PER_PAGE ?? '100'; export const fetchUserProfile = async (token: string) => { - const res = await fetch('${GITHUB_API}/user', { + const res = await fetch(`${GITHUB_API}/user`, { headers: { Authorization: `Bearer ${token}`, Accept: 'application/vnd.github.v3+json', @@ -17,7 +17,7 @@ export const fetchUserProfile = async (token: string) => { export const fetchUserRepos = async (token: string) => { const res = await fetch( - '${GITHUB_API}/user/repos?sort=updated&per_page=${PER_PAGE}&type=all', + `${GITHUB_API}/user/repos?sort=updated&per_page=${PER_PAGE}&type=all`, { headers: { Authorization: `Bearer ${token}`, @@ -76,7 +76,7 @@ export const fetchRepoContributorStats = async (token?: string) => { } let res = await fetch( - '${GITHUB_API}/repos/${DEVPATH_REPO}/stats/contributors', + `${GITHUB_API}/repos/${DEVPATH_REPO}/stats/contributors`, { headers } ); @@ -85,7 +85,7 @@ export const fetchRepoContributorStats = async (token?: string) => { while (res.status === 202 && retries < 3) { await new Promise((resolve) => setTimeout(resolve, 1500)); res = await fetch( - '${GITHUB_API}/repos/${DEVPATH_REPO}/stats/contributors', + `${GITHUB_API}/repos/${DEVPATH_REPO}/stats/contributors`, { headers } ); retries++;