diff --git a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/evaluations/page.tsx b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/evaluations/page.tsx
index 0886f6cc0..8f00de68a 100644
--- a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/evaluations/page.tsx
+++ b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/evaluations/page.tsx
@@ -1,11 +1,16 @@
import { ROUTES } from '$/services/routes'
import { redirect } from 'next/navigation'
-export default function EvaluationsPage({
- params: { projectId, documentUuid, commitUuid },
+export default async function EvaluationsPage({
+ params,
}: {
- params: { projectId: string; documentUuid: string; commitUuid: string }
+ params: Promise<{
+ projectId: string
+ documentUuid: string
+ commitUuid: string
+ }>
}) {
+ const { projectId, documentUuid, commitUuid } = await params
redirect(
ROUTES.projects
.detail({ id: Number(projectId) })
diff --git a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/layout.tsx b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/layout.tsx
index 8b0dcce8d..a29393bb7 100644
--- a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/layout.tsx
+++ b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/layout.tsx
@@ -18,12 +18,15 @@ export default async function DocumentPage({
params,
children,
}: {
- params: { projectId: string; commitUuid: string; documentUuid: string }
+ params: Promise<{
+ projectId: string
+ commitUuid: string
+ documentUuid: string
+ }>
children: ReactNode
}) {
- const projectId = Number(params.projectId)
- const documentUuid = params.documentUuid
- const commitUuid = params.commitUuid
+ const { projectId: pjid, commitUuid, documentUuid } = await params
+ const projectId = Number(pjid)
try {
const apiKeys = await getApiKeysCached()
@@ -47,11 +50,11 @@ export default async function DocumentPage({
>
- {children}
+ {children}
@@ -59,8 +62,8 @@ export default async function DocumentPage({
} catch (error) {
return redirect(
ROUTES.projects
- .detail({ id: Number(params.projectId) })
- .commits.detail({ uuid: params.commitUuid }).documents.root,
+ .detail({ id: Number(projectId) })
+ .commits.detail({ uuid: commitUuid }).documents.root,
)
}
}
diff --git a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/logs/page.tsx b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/logs/page.tsx
index ad5cff057..e3b4503ca 100644
--- a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/logs/page.tsx
+++ b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/logs/page.tsx
@@ -38,16 +38,20 @@ export default async function DocumentPage({
params,
searchParams,
}: {
- params: { projectId: string; commitUuid: string; documentUuid: string }
- searchParams: QueryParams
+ params: Promise<{
+ projectId: string
+ commitUuid: string
+ documentUuid: string
+ }>
+ searchParams: Promise
}) {
const { workspace } = await getCurrentUser()
- const projectId = Number(params.projectId)
- const commitUuid = params.commitUuid
- const documentUuid = params.documentUuid
+ const { projectId: pjid, commitUuid, documentUuid } = await params
+ const projectId = Number(pjid)
const commit = await findCommitCached({ projectId, uuid: commitUuid })
- const documentLogUuid = searchParams.logUuid?.toString()
- const page = searchParams.page?.toString?.()
+ const { logUuid, pageSize, page: pg } = await searchParams
+ const documentLogUuid = logUuid?.toString()
+ const page = pg?.toString?.()
const currentLogPage = await fetchDocumentLogPage({
workspace,
commit,
@@ -69,7 +73,7 @@ export default async function DocumentPage({
documentUuid,
draft: commit,
page,
- pageSize: searchParams.pageSize as string | undefined,
+ pageSize: pageSize as string | undefined,
})
const selectedLog = rows.find((r) => r.uuid === documentLogUuid)
@@ -92,8 +96,8 @@ export default async function DocumentPage({
href={
ROUTES.projects
.detail({ id: projectId })
- .commits.detail({ uuid: params.commitUuid })
- .documents.detail({ uuid: params.documentUuid }).logs.upload
+ .commits.detail({ uuid: commitUuid })
+ .documents.detail({ uuid: documentUuid }).logs.upload
}
>