Skip to content

Commit

Permalink
chore(fe): fix route params type (#2245)
Browse files Browse the repository at this point in the history
  • Loading branch information
eunnbi authored Nov 28, 2024
1 parent b876f14 commit b8b63ea
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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

const isProblemPubliclyAvailable =
(await fetcher.head(`problem/${problemId}`)).status === 200
return (
<>
<ContestEditorSkeleton></ContestEditorSkeleton>
<ContestEditorSkeleton />
<div className="fixed inset-0 z-50 flex items-center justify-center bg-opacity-10 text-white backdrop-blur-md">
<div className="text-center">
<h1 className="mb-8 font-mono text-2xl">The contest has finished!</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,9 +33,9 @@ export default async function Page({
}
>
<SubmissionDetail
problemId={problemId}
contestId={contestId}
submissionId={submissionId}
problemId={Number(problemId)}
contestId={Number(contestId)}
submissionId={Number(submissionId)}
/>
</Suspense>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default async function Page({
params
}: {
params: {
problemId: number
submissionId: number
problemId: string
submissionId: string
}
}) {
const { submissionId, problemId } = params
Expand All @@ -31,7 +31,10 @@ export default async function Page({
</div>
}
>
<SubmissionDetail problemId={problemId} submissionId={submissionId} />
<SubmissionDetail
problemId={Number(problemId)}
submissionId={Number(submissionId)}
/>
</Suspense>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit b8b63ea

Please sign in to comment.