Skip to content

Commit

Permalink
Fix pr #14: Fix issue #13: Add the option to sort PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
openhands-agent committed Dec 29, 2024
1 parent 3321885 commit 3ccaa13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/PullRequestViewer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


import React from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import PullRequestViewer from './PullRequestViewer';

Expand Down
9 changes: 4 additions & 5 deletions src/PullRequestViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@



import React, { useState, useEffect } from 'react';
import { Octokit } from '@octokit/rest';
import Select from 'react-select';
Expand Down Expand Up @@ -52,7 +51,7 @@ const PullRequestViewer: React.FC = () => {
org: GITHUB_ORG,
type: 'all',
});
const repoOptions = response.data.map(repo => ({
const repoOptions = response.data.map((repo) => ({
value: repo.name,
label: repo.name,
}));
Expand All @@ -68,7 +67,7 @@ const PullRequestViewer: React.FC = () => {
const fetchPullRequests = async () => {
if (selectedRepo) {
try {
let allPullRequests: PullRequest[] = [];
const allPullRequests: PullRequest[] = [];
let page = 1;
let hasNextPage = true;

Expand All @@ -78,10 +77,10 @@ const PullRequestViewer: React.FC = () => {
repo: selectedRepo.value,
state: 'open',
per_page: 100,
page: page,
page,
});

allPullRequests = [...allPullRequests, ...response.data];
allPullRequests.push(...response.data);

if (response.data.length < 100) {
hasNextPage = false;
Expand Down

0 comments on commit 3ccaa13

Please sign in to comment.