From b8b63ea920d1d6ca564b553514d32076dcd5b8f7 Mon Sep 17 00:00:00 2001 From: Eunbi Kang Date: Thu, 28 Nov 2024 14:27:00 +0900 Subject: [PATCH] chore(fe): fix route params type (#2245) --- .../finished/problem/[problemId]/page.tsx | 4 ++-- .../[problemId]/submission/[submissionId]/page.tsx | 12 ++++++------ .../(code-editor)/problem/[problemId]/page.tsx | 2 +- .../[problemId]/submission/[submissionId]/page.tsx | 9 ++++++--- .../(client)/(main)/contest/[contestId]/layout.tsx | 9 ++------- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/apps/frontend/app/(client)/(code-editor)/contest/[contestId]/finished/problem/[problemId]/page.tsx b/apps/frontend/app/(client)/(code-editor)/contest/[contestId]/finished/problem/[problemId]/page.tsx index 53c3d6c609..cd375ebdac 100644 --- a/apps/frontend/app/(client)/(code-editor)/contest/[contestId]/finished/problem/[problemId]/page.tsx +++ b/apps/frontend/app/(client)/(code-editor)/contest/[contestId]/finished/problem/[problemId]/page.tsx @@ -9,7 +9,7 @@ import ContestEditorSkeleton from './_components/ContestEditorSkeleton' export default async function ContestFinishedPage({ params }: { - params: { problemId: number; contestId: number } + params: { problemId: string; contestId: string } }) { const { problemId, contestId } = params @@ -17,7 +17,7 @@ export default async function ContestFinishedPage({ (await fetcher.head(`problem/${problemId}`)).status === 200 return ( <> - +

The contest has finished!

diff --git a/apps/frontend/app/(client)/(code-editor)/contest/[contestId]/problem/[problemId]/submission/[submissionId]/page.tsx b/apps/frontend/app/(client)/(code-editor)/contest/[contestId]/problem/[problemId]/submission/[submissionId]/page.tsx index c7c3e79da1..41de08b3f7 100644 --- a/apps/frontend/app/(client)/(code-editor)/contest/[contestId]/problem/[problemId]/submission/[submissionId]/page.tsx +++ b/apps/frontend/app/(client)/(code-editor)/contest/[contestId]/problem/[problemId]/submission/[submissionId]/page.tsx @@ -8,9 +8,9 @@ export default async function Page({ params }: { params: { - problemId: number - contestId: number - submissionId: number + problemId: string + contestId: string + submissionId: string } }) { const { submissionId, problemId, contestId } = params @@ -33,9 +33,9 @@ export default async function Page({ } >
diff --git a/apps/frontend/app/(client)/(code-editor)/problem/[problemId]/page.tsx b/apps/frontend/app/(client)/(code-editor)/problem/[problemId]/page.tsx index 8ffb032c9d..a6524fc109 100644 --- a/apps/frontend/app/(client)/(code-editor)/problem/[problemId]/page.tsx +++ b/apps/frontend/app/(client)/(code-editor)/problem/[problemId]/page.tsx @@ -5,7 +5,7 @@ import type { ProblemDetail } from '@/types/type' export default async function DescriptionPage({ params }: { - params: { problemId: number } + params: { problemId: string } }) { const { problemId } = params const problem: ProblemDetail = await fetcher(`problem/${problemId}`).json() diff --git a/apps/frontend/app/(client)/(code-editor)/problem/[problemId]/submission/[submissionId]/page.tsx b/apps/frontend/app/(client)/(code-editor)/problem/[problemId]/submission/[submissionId]/page.tsx index 26d303adc9..70320beb64 100644 --- a/apps/frontend/app/(client)/(code-editor)/problem/[problemId]/submission/[submissionId]/page.tsx +++ b/apps/frontend/app/(client)/(code-editor)/problem/[problemId]/submission/[submissionId]/page.tsx @@ -8,8 +8,8 @@ export default async function Page({ params }: { params: { - problemId: number - submissionId: number + problemId: string + submissionId: string } }) { const { submissionId, problemId } = params @@ -31,7 +31,10 @@ export default async function Page({
} > - + ) diff --git a/apps/frontend/app/(client)/(main)/contest/[contestId]/layout.tsx b/apps/frontend/app/(client)/(main)/contest/[contestId]/layout.tsx index 6828596034..5fd1cdd447 100644 --- a/apps/frontend/app/(client)/(main)/contest/[contestId]/layout.tsx +++ b/apps/frontend/app/(client)/(main)/contest/[contestId]/layout.tsx @@ -13,15 +13,10 @@ interface ContestDetailProps { params: { contestId: string } + tabs: React.ReactNode } -export default async function Layout({ - params, - tabs -}: { - params: ContestDetailProps['params'] - tabs: React.ReactNode -}) { +export default async function Layout({ params, tabs }: ContestDetailProps) { const { contestId } = params const session = await auth()