🐙 Fetch GitHub Repos (#14)

* edit package.json

* eslint

* fetch git repos

* create repo array on fetch

* update repo array on profile edit

* edit profile presentation

* show only public repos

* repo link target blank
This commit is contained in:
Ruidy 2020-06-02 13:44:23 +02:00 committed by GitHub
parent bd05e6bd5e
commit be59fa12aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,14 +18,17 @@ const getGithubRepos = async (owner: string) => {
const {data: repos} = await octokit.repos.listForAuthenticatedUser({ const {data: repos} = await octokit.repos.listForAuthenticatedUser({
owner, owner,
}); });
const newRepo: Repo[] = repos.map((r: any) => ({
url: r.url, const newRepo: Repo[] = repos
stars: r.stargazers_count, .filter((r: any) => r.private === false)
forks: r.forks_count, .map((r: any) => ({
description: r.description, url: r.html_url,
name: r.name, stars: r.stargazers_count,
watchers: r.watchers_count, forks: r.forks_count,
})); description: r.description,
name: r.name,
watchers: r.watchers_count,
}));
return newRepo; return newRepo;
} catch (err) { } catch (err) {
console.error(err); console.error(err);