feat: process 2 pages of events
This commit is contained in:
@@ -1,7 +1,17 @@
|
|||||||
export default async function getEvents(repo, { body, actor } = {}) {
|
export default async function getEvents(repo, { body, actor } = {}) {
|
||||||
const { items: events } = await repo.events.fetch();
|
const events = await repo.events.fetch();
|
||||||
|
|
||||||
return events
|
const items = await (async () => {
|
||||||
|
// process 2 pages of events
|
||||||
|
if (events.nextPage) {
|
||||||
|
const moreEvents = await events.nextPage.fetch();
|
||||||
|
return [...events.items, ...moreEvents.items];
|
||||||
|
}
|
||||||
|
|
||||||
|
return events.items;
|
||||||
|
})();
|
||||||
|
|
||||||
|
return items
|
||||||
.map(comment => {
|
.map(comment => {
|
||||||
// only comments created by specific user
|
// only comments created by specific user
|
||||||
if (comment.type !== 'IssueCommentEvent') return false;
|
if (comment.type !== 'IssueCommentEvent') return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user