Skip to content

Commit ffb6241

Browse files
committed
Compiles with Next 15
1 parent c376d4b commit ffb6241

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/app/api/blob/[owner]/[repository]/[...path]/route.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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
})

src/app/api/remotes/[encodedRemoteConfig]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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 {

src/app/documentation-viewer/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ type SearchParams = { visualizer: string, url: string }
55
export 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
}

0 commit comments

Comments
 (0)