Skip to content

Commit 3370ccf

Browse files
committed
fetch comments after PRs
1 parent 49e384c commit 3370ccf

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

code/script.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,23 @@ const handlePullRequest = (repoElementId, myPullRequests) => {
110110
<p>${data.length} commits</p>
111111
<p>latest: <a href=${commitUrl}>${commitMessage}</a> by ${commitAuthor} ${commitTimeSince}</p>
112112
</div>
113-
`
113+
`
114+
115+
116+
myPullRequests
117+
.map(pullRequest => pullRequest.review_comments_url)
118+
.forEach(reviewCommentUrl => {
119+
fetch(reviewCommentUrl + "?per_page=100", options)
120+
.then(res => res.json())
121+
.then(data => {
122+
const repo = document.getElementById(repoElementId);
123+
repo.innerHTML += `
124+
<div class="comments">
125+
<span>received ${data.length} comments</span>
126+
</div>
127+
`
128+
})
129+
})
114130
})
115131
})
116132

0 commit comments

Comments
 (0)