diff --git a/app/(auth)/admin/multi-logs/[slug]/page.tsx b/app/(auth)/admin/multi-logs/[slug]/page.tsx index 816cac5..3a66674 100644 --- a/app/(auth)/admin/multi-logs/[slug]/page.tsx +++ b/app/(auth)/admin/multi-logs/[slug]/page.tsx @@ -41,9 +41,11 @@ const EditPage = ({ params }: { params: { slug: string } }) => { if (response.ok) { setLoading(false); toast({ description: "Page successfully updated" }); - router.push("/admin/multi-logs"); + router.push(`/admin/multi-logs/`); } else { setLoading(false); + // TEMPERARORY ERROR + router.push(`/admin/multi-logs/`); toast({ description: "Updated but cant return data" }); } }; diff --git a/app/(auth)/admin/multi-logs/page.tsx b/app/(auth)/admin/multi-logs/page.tsx index 2f00fa3..83791b8 100644 --- a/app/(auth)/admin/multi-logs/page.tsx +++ b/app/(auth)/admin/multi-logs/page.tsx @@ -55,6 +55,7 @@ const MultiLogs = () => { setPages([...pages, newPage]); setPageTitle(""); setOpen(false); + router.push(`/admin/multi-pages/${slug}`); toast({ description: "Page created successfully" }); } else { const errorData = await response.json(); diff --git a/app/api/mdx/pages/route.ts b/app/api/mdx/pages/route.ts index 74f3d58..a3fedb1 100644 --- a/app/api/mdx/pages/route.ts +++ b/app/api/mdx/pages/route.ts @@ -22,7 +22,7 @@ export const POST = async (req: NextRequest) => { const db = client.db(); const { title, slug, content } = await req.json(); - if (!title || !slug || !content) { + if (!slug) { return NextResponse.json( { message: "Missing required fields" }, { status: 400 }