File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11const USER = "amandatilly" ;
22const REPOS_URL = `https://api.github.com/users/${ USER } /repos` ;
3- const PR_URL = `https://api.github.com/repos/Technigo/${ reponame } /pulls` ;
3+ const NEWSSITE_URL =
4+ "https://api.github.com/repos/Technigo/project-news-site/pulls/222/commits" ;
5+
46const projectContainer = document . getElementById ( "projects" ) ;
57
68const getRepos = ( ) => {
79 fetch ( REPOS_URL )
810 . then ( ( res ) => res . json ( ) )
911 . then ( ( data ) => {
1012 console . log ( data ) ;
11- // data.forEach((repo) => console.log(repo.name));
13+
1214 const forkedRepos = data . filter (
1315 ( repo ) => repo . fork && repo . name . startsWith ( "project-" )
1416 ) ;
1517 forkedRepos . forEach (
1618 ( repo ) => ( projectContainer . innerHTML += `<h3>${ repo . name } </h3>` )
1719 ) ;
20+ getPullRequests ( forkedRepos ) ;
1821 } ) ;
1922} ;
2023
2124const getPullRequests = ( repos ) => {
2225 repos . forEach ( ( repo ) => {
23- fetch ( PR_URL )
26+ fetch (
27+ `https://api.github.com/repos/Technigo/${ repo . name } /pulls?per_page=100`
28+ )
2429 . then ( ( res ) => res . json ( ) )
25- . then ( ( data ) => { } ) ;
30+ . then ( ( data ) => {
31+ // console.log(data);
32+ const userPullRequests = data . filter (
33+ ( pull ) => pull . user . login === repo . owner . login
34+ ) ;
35+ console . log ( userPullRequests ) ;
36+ } ) ;
2637 } ) ;
2738} ;
2839
You can’t perform that action at this time.
0 commit comments