Skip to content

Commit

Permalink
Update githubSearch.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
katexpl authored Nov 23, 2023
1 parent 8a5ee6e commit ede0554
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/pages/githubSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const GithubSearch: React.FC = () => {
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
try {
// Get user email
const response: AxiosResponse = await axios.get(
`https://api.github.com/users/${userLogin}`
);
Expand All @@ -21,14 +20,12 @@ const GithubSearch: React.FC = () => {
console.error("Failed to retrieve login.");
}

// Get user's last 5 updated projects
const projects: AxiosResponse = await axios.get(
`https://api.github.com/users/${userLogin}/repos?sort=updated&direction=desc&per_page=5`
);
setUserProjects(projects.data);

if (projects.data) {
// Get the last 5 commits for each project
const commits = await Promise.all(
projects.data.map(async (project: IProject) => {
if (project.size === 0) {
Expand Down

0 comments on commit ede0554

Please sign in to comment.