This commit is contained in:
2026-07-16 09:53:14 +07:00
parent 0fc112a2e8
commit 29cec708a3
1236 changed files with 212848 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { NextRequest, NextResponse } from 'next/server';
import { buildOnlineLessonAttachmentResponse } from '@/features/online-lessons/server/online-lesson-attachment-response';
type Params = { params: Promise<{ id: string }> };
export const runtime = 'nodejs';
function parseLessonId(value: string) {
const lessonId = Number(value);
return Number.isNaN(lessonId) ? null : lessonId;
}
export async function GET(_request: NextRequest, { params }: Params) {
const { id } = await params;
const lessonId = parseLessonId(id);
if (!lessonId) {
return NextResponse.json({ message: 'Invalid online lesson attachment request' }, { status: 400 });
}
return buildOnlineLessonAttachmentResponse({
lessonId,
disposition: 'inline'
});
}