From 897c58c636f2bcb627c2a4789e7db98c3f21195d Mon Sep 17 00:00:00 2001 From: lavanyagarg112 Date: Thu, 10 Jul 2025 22:17:48 +0800 Subject: [PATCH] Fix params issue --- app/courses/[courseId]/edit/page.tsx | 2 +- app/courses/[courseId]/layout.tsx | 2 +- app/courses/[courseId]/modules/[moduleId]/edit/page.tsx | 2 +- app/courses/[courseId]/modules/[moduleId]/page.tsx | 2 +- app/courses/[courseId]/modules/new/page.tsx | 2 +- app/courses/[courseId]/page.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/courses/[courseId]/edit/page.tsx b/app/courses/[courseId]/edit/page.tsx index 99b32c9..9e30ebe 100644 --- a/app/courses/[courseId]/edit/page.tsx +++ b/app/courses/[courseId]/edit/page.tsx @@ -8,7 +8,7 @@ export default async function EditCoursePage({ params: { courseId: string }; }) { const user = await getAuthUser(); - const { courseId } = await params; + const { courseId } = params; if (user?.organisation?.role !== "admin") { redirect(`/courses/${courseId}`); } diff --git a/app/courses/[courseId]/layout.tsx b/app/courses/[courseId]/layout.tsx index c1d7f8a..8f7dce6 100644 --- a/app/courses/[courseId]/layout.tsx +++ b/app/courses/[courseId]/layout.tsx @@ -11,7 +11,7 @@ export default async function CourseLayout({ }) { const user = await getAuthUser(); const isAdmin = user?.organisation?.role === "admin"; - const { courseId } = await params; + const { courseId } = params; const response = { id: courseId, diff --git a/app/courses/[courseId]/modules/[moduleId]/edit/page.tsx b/app/courses/[courseId]/modules/[moduleId]/edit/page.tsx index dd6b95e..02c62e5 100644 --- a/app/courses/[courseId]/modules/[moduleId]/edit/page.tsx +++ b/app/courses/[courseId]/modules/[moduleId]/edit/page.tsx @@ -8,7 +8,7 @@ export default async function EditModulePage({ params: { courseId: string; moduleId: string }; }) { const user = await getAuthUser(); - const { courseId, moduleId } = await params; + const { courseId, moduleId } = params; if (!courseId || !moduleId) { redirect("/courses"); } diff --git a/app/courses/[courseId]/modules/[moduleId]/page.tsx b/app/courses/[courseId]/modules/[moduleId]/page.tsx index 5c7337c..70037cd 100644 --- a/app/courses/[courseId]/modules/[moduleId]/page.tsx +++ b/app/courses/[courseId]/modules/[moduleId]/page.tsx @@ -9,7 +9,7 @@ export default async function ModulePage({ }) { const user = await getAuthUser(); const isAdmin = user?.organisation?.role === "admin"; - const { courseId, moduleId } = await params; + const { courseId, moduleId } = params; return (
diff --git a/app/courses/[courseId]/modules/new/page.tsx b/app/courses/[courseId]/modules/new/page.tsx index e11a5c1..3d43f64 100644 --- a/app/courses/[courseId]/modules/new/page.tsx +++ b/app/courses/[courseId]/modules/new/page.tsx @@ -8,7 +8,7 @@ export default async function NewModulePage({ params: { courseId: string }; }) { const user = await getAuthUser(); - const { courseId } = await params; + const { courseId } = params; if (!courseId) { redirect("/courses"); } diff --git a/app/courses/[courseId]/page.tsx b/app/courses/[courseId]/page.tsx index 3f8f466..13a3880 100644 --- a/app/courses/[courseId]/page.tsx +++ b/app/courses/[courseId]/page.tsx @@ -8,7 +8,7 @@ export default async function CoursePage({ }) { const user = await getAuthUser(); const isAdmin = user?.organisation?.role === "admin"; - const { courseId } = await params; + const { courseId } = params; return ; }