diff --git a/src/components/ui/ContributorPage.tsx b/src/components/ui/ContributorPage.tsx index 5585e10..f34923b 100644 --- a/src/components/ui/ContributorPage.tsx +++ b/src/components/ui/ContributorPage.tsx @@ -136,30 +136,19 @@ export default function ContributorPage() { const fetchData = async () => { try { let allContributors: Contributor[] = []; - let page = 1; - const perPage = 100; - - while (true) { - const contributorsResponse = await fetch( - `https://api.github.com/repos/ajaynegi45/Uttarakhand-Culture-NewUI/contributors?page=${page}&per_page=${perPage}`, - ); - - if (!contributorsResponse.ok) { - throw new Error('Failed to fetch contributors data'); - } - const contributorsData: Contributor[] = - await contributorsResponse.json(); + const contributorsResponse = await fetch("https://api.github.com/repos/ajaynegi45/Uttarakhand-Culture-NewUI/contributors?page=1&per_page=100") + if (!contributorsResponse.ok) { + throw new Error('Failed to fetch contributors data'); + } + const contributorsData: Contributor[] = + await contributorsResponse.json(); - if (contributorsData.length === 0) break; + allContributors = [...allContributors, ...contributorsData]; - allContributors = [...allContributors, ...contributorsData]; - page++; - } setContributors(allContributors); const repoResponse = await fetch( - 'https://api.github.com/repos/ajaynegi45/Uttarakhand-Culture-NewUI', - ); + 'https://api.github.com/repos/ajaynegi45/Uttarakhand-Culture-NewUI') const repoData = await repoResponse.json(); setRepoStats({ stars: repoData.stargazers_count, @@ -290,7 +279,7 @@ export default function ContributorPage() { label="Forks" value={repoStats.forks} icon={ - + } /> + } />