File size: 667 Bytes
65d68f5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import { NextResponse } from "next/server";
import { getVisualLessonFrames } from "@/lib/knowledge-base/sslc-physics";
export async function GET(request: Request) {
const { searchParams } = new URL(request.url);
const chapterId = searchParams.get("chapterId");
if (!chapterId) {
return NextResponse.json({ error: "chapterId is required" }, { status: 400 });
}
try {
const data = getVisualLessonFrames(chapterId);
if (!data) {
return NextResponse.json({ error: "Not found" }, { status: 404 });
}
return NextResponse.json(data);
} catch {
return NextResponse.json({ error: "Internal server error" }, { status: 500 });
}
}
|