File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed
blob/[owner]/[repository]/[...path]
remotes/[encodedRemoteConfig] Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,16 @@ interface GetBlobParams {
88 path : [ string ]
99}
1010
11- export async function GET ( req : NextRequest , { params } : { params : GetBlobParams } ) {
11+ export async function GET ( req : NextRequest , { params } : { params : Promise < GetBlobParams > } ) {
1212 const isAuthenticated = await session . getIsAuthenticated ( )
1313 if ( ! isAuthenticated ) {
1414 return makeUnauthenticatedAPIErrorResponse ( )
1515 }
16- const path = params . path . join ( "/" )
16+ const { path : paramsPath , owner, repository } = await params
17+ const path = paramsPath . join ( "/" )
1718 const item = await userGitHubClient . getRepositoryContent ( {
18- repositoryOwner : params . owner ,
19- repositoryName : params . repository ,
19+ repositoryOwner : owner ,
20+ repositoryName : repository ,
2021 path : path ,
2122 ref : req . nextUrl . searchParams . get ( "ref" ) ?? undefined
2223 } )
Original file line number Diff line number Diff line change @@ -7,13 +7,14 @@ interface RemoteSpecificationParams {
77 encodedRemoteConfig : string
88}
99
10- export async function GET ( _req : NextRequest , { params } : { params : RemoteSpecificationParams } ) {
10+ export async function GET ( _req : NextRequest , { params } : { params : Promise < RemoteSpecificationParams > } ) {
1111 const isAuthenticated = await session . getIsAuthenticated ( )
1212 if ( ! isAuthenticated ) {
1313 return makeUnauthenticatedAPIErrorResponse ( )
1414 }
1515
16- const remoteConfig = remoteConfigEncoder . decode ( params . encodedRemoteConfig )
16+ const { encodedRemoteConfig } = await params
17+ const remoteConfig = remoteConfigEncoder . decode ( encodedRemoteConfig )
1718
1819 let url : URL
1920 try {
Original file line number Diff line number Diff line change @@ -5,12 +5,13 @@ type SearchParams = { visualizer: string, url: string }
55export default async function Page ( {
66 searchParams
77} : {
8- searchParams : SearchParams
8+ searchParams : Promise < SearchParams >
99} ) {
10+ const { visualizer, url } = await searchParams
1011 return (
1112 < DocumentationViewer
12- visualizer = { parseInt ( searchParams . visualizer ) }
13- url = { searchParams . url }
13+ visualizer = { parseInt ( visualizer ) }
14+ url = { url }
1415 />
1516 )
1617}
You can’t perform that action at this time.
0 commit comments