diff --git a/app/(hacktoberfest)/oss-issues/page.tsx b/app/(hacktoberfest)/oss-issues/page.tsx index 03ec515..7e60390 100644 --- a/app/(hacktoberfest)/oss-issues/page.tsx +++ b/app/(hacktoberfest)/oss-issues/page.tsx @@ -1,19 +1,23 @@ -import { getAllOssGgIssuesOfRepos } from "@/lib/github/service"; +import { getOssIssuesForRepo } from "@/lib/github/service"; import { getAllRepositories } from "@/lib/repository/service"; import { TPullRequest } from "@/types/pullRequest"; import Link from "next/link"; export default async function IssuesPage() { const ossGgRepositories = await getAllRepositories(); - const pullRequests: TPullRequest[] = await getAllOssGgIssuesOfRepos( - ossGgRepositories.map((repo) => ({ id: repo.githubId, fullName: `${repo.owner}/${repo.name}` })) + + const issuesPromises = ossGgRepositories.map((repo) => + getOssIssuesForRepo(repo.githubId, `${repo.owner}/${repo.name}`) ); + const issuesArrays = await Promise.all(issuesPromises); + const issues: TPullRequest[] = issuesArrays.flat(); + return (
-

available issues ({pullRequests.length})

+

available issues ({issues.length})