feat: Implement granular API for video upload/update and attachment management with dedicated types and endpoints.

This commit is contained in:
JakkrapartXD 2026-01-26 17:23:26 +07:00
parent e082c77946
commit be7348c74d
4 changed files with 580 additions and 215 deletions

View file

@ -24,6 +24,8 @@ import {
UpdateQuestionBody,
ReorderQuestionResponse,
ReorderQuestionBody,
UpdateQuizResponse,
UpdateQuizBody,
} from '../types/ChaptersLesson.typs';
const chaptersLessonService = new ChaptersLessonService();
@ -352,4 +354,28 @@ export class ChaptersLessonInstructorController {
question_id: questionId,
});
}
/**
* Quiz
* Update quiz settings
*/
@Put('chapters/{chapterId}/lessons/{lessonId}/quiz')
@Security('jwt', ['instructor'])
@SuccessResponse('200', 'Quiz updated successfully')
public async updateQuiz(
@Request() request: any,
@Path() courseId: number,
@Path() chapterId: number,
@Path() lessonId: number,
@Body() body: UpdateQuizBody
): Promise<UpdateQuizResponse> {
const token = request.headers.authorization?.replace('Bearer ', '');
if (!token) throw new ValidationError('No token provided');
return await chaptersLessonService.updateQuiz({
token,
course_id: courseId,
lesson_id: lessonId,
...body,
});
}
}