This commit is contained in:
JakkrapartXD 2026-01-22 16:22:33 +07:00
parent 5c2b5d55aa
commit dcf0385a87

View file

@ -182,6 +182,10 @@ export class ChaptersLessonService {
if (!currentChapter) {
throw new NotFoundError('Chapter not found');
}
// Validate chapter belongs to the specified course
if (currentChapter.course_id !== course_id) {
throw new NotFoundError('Chapter not found in this course');
}
const oldSortOrder = currentChapter.sort_order;
// If same position, no need to reorder