Polish UX: auto-redirect on create, fix design consistency

- createModule now redirects to module page after creation
- createLesson now redirects to lesson editor after creation
- Regenerate Prisma client to fix missing types (category, accessLog, expiresAt)
- Rewrite sortable-modules/lessons with Second Brain design tokens (remove amber/slate)
- Rewrite lesson-editor toolbar and toggle with design tokens
- Fix register page/form: replace amber theme with card-aubade design

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-07 12:38:46 +05:00
parent 05dd4d1df2
commit 07b9a6d261
8 changed files with 304 additions and 127 deletions
+3 -1
View File
@@ -4,6 +4,7 @@ import { prisma } from "@/lib/prisma";
import { headers } from "next/headers";
import { auth } from "@/lib/auth";
import { revalidatePath } from "next/cache";
import { redirect } from "next/navigation";
async function requireAdmin() {
const session = await auth.api.getSession({ headers: await headers() });
@@ -17,8 +18,9 @@ export async function createModule(courseId: string, formData: FormData) {
await requireAdmin();
const title = formData.get("title") as string;
const count = await prisma.module.count({ where: { courseId } });
await prisma.module.create({ data: { courseId, title, order: count } });
const mod = await prisma.module.create({ data: { courseId, title, order: count } });
revalidatePath(`/admin/courses/${courseId}`);
redirect(`/admin/courses/${courseId}/modules/${mod.id}`);
}
export async function updateModule(moduleId: string, courseId: string, formData: FormData) {