diff --git a/src/utils/api-client.ts b/src/utils/github-client.ts similarity index 92% rename from src/utils/api-client.ts rename to src/utils/github-client.ts index 333229a..f9cb750 100644 --- a/src/utils/api-client.ts +++ b/src/utils/github-client.ts @@ -16,6 +16,6 @@ const get = async (url: string) => { } }; -export const apiClient = { +export const githubClient = { get, }; diff --git a/src/utils/index.ts b/src/utils/index.ts index 1960100..b5d5612 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1 +1 @@ -export * from './api-client'; +export * from './github-client'; diff --git a/src/views/community-projects.astro b/src/views/community-projects.astro index 54c77f1..bbfad3e 100644 --- a/src/views/community-projects.astro +++ b/src/views/community-projects.astro @@ -1,6 +1,6 @@ --- import type { GithubRepo } from '@/types'; -import { apiClient } from '@/utils'; +import { githubClient } from '@/utils'; import RepoCard from '@/components/repo-card.astro'; @@ -37,7 +37,7 @@ const PROJECTS = [ const data: Array = await Promise.all( PROJECTS.map(async ({ username, repo }) => { - return apiClient.get(`https://api.github.com/repos/${username}/${repo}`); + return githubClient.get(`https://api.github.com/repos/${username}/${repo}`); }), ); --- diff --git a/src/views/open-source-projects.astro b/src/views/open-source-projects.astro index 0ce20b6..913c9d9 100644 --- a/src/views/open-source-projects.astro +++ b/src/views/open-source-projects.astro @@ -1,12 +1,12 @@ --- import type { GithubRepo } from '@/types'; -import { apiClient } from '@/utils'; +import { githubClient } from '@/utils'; import RepoCard from '@/components/repo-card.astro'; const HIDDEN_REPOS = ['action-send-mail', '.github']; -const data = await apiClient +const data = await githubClient .get('https://api.github.com/orgs/craftgate/repos') .then((res: Array) => res.filter((repo) => !HIDDEN_REPOS.includes(repo.name)), diff --git a/src/views/team.astro b/src/views/team.astro index 4c01d6c..d96e023 100644 --- a/src/views/team.astro +++ b/src/views/team.astro @@ -1,6 +1,6 @@ --- import type { GithubUser } from '@/types'; -import { apiClient } from '@/utils'; +import { githubClient } from '@/utils'; import TeamMemberCard from '@/components/team-member-card.astro'; @@ -11,7 +11,7 @@ const HIDDEN_MEMBERS = [ 'ozturkselin', ]; -const data = await apiClient +const data = await githubClient .get('https://api.github.com/orgs/craftgate/members') .then((res: Array>) => res.filter((member) => !HIDDEN_MEMBERS.includes(member.login)), @@ -19,7 +19,7 @@ const data = await apiClient .then((members) => { return Promise.all( members.map(async (member) => { - return apiClient.get(`https://api.github.com/users/${member.login}`); + return githubClient.get(`https://api.github.com/users/${member.login}`); }), ); });