File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ const TopThreeContributors: FC = () => {
2424
2525 try {
2626 const response = await axios . get ( '/api/topThreeUsers' , {
27- timeout : 8000
27+ timeout : 30000
2828 } ) ;
2929
30- // Log debug messages from headers
3130 for ( let i = 1 ; i <= 5 ; i ++ ) {
3231 const message = response . headers [ `x-debug-message${ i ? '-' + i : '' } ` ] ;
3332 if ( message ) {
@@ -39,7 +38,7 @@ const TopThreeContributors: FC = () => {
3938 const fetchedData = response . data ;
4039
4140 if ( Array . isArray ( fetchedData ) && fetchedData . length > 0 ) {
42- // Sort the data by contributions in descending order
41+ //* Sort the data by contributions in descending order
4342 const sortedData = [ ...fetchedData ] . sort ( ( a , b ) => b . contributions - a . contributions ) ;
4443
4544 const mappedData : Contributor [ ] = sortedData
@@ -145,3 +144,4 @@ export { TopThreeContributors }
145144
146145
147146
147+
Original file line number Diff line number Diff line change 55import { fetchTopThreeUsersByPullRequests } from "../../utils/fetchTopThreeUsersByPullRequests" ;
66
77export default async ( req , res ) => {
8- // Set CORS headers
98 res . setHeader ( 'Access-Control-Allow-Origin' , '*' ) ;
109 res . setHeader ( 'Access-Control-Allow-Methods' , 'GET' ) ;
1110 res . setHeader ( 'Access-Control-Allow-Headers' , 'Content-Type' ) ;
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ export async function fetchTopThreeUsersByPullRequests(repoPath: string) {
2828 }
2929 } ) ;
3030
31- // Handle pagination
3231 const linkHeader = response . headers . link ;
3332 const nextLink = linkHeader
3433 ? linkHeader . split ( "," ) . find ( ( s : string ) => s . includes ( 'rel="next"' ) )
You can’t perform that action at this time.
0 commit comments