feat: Implement granular API for video upload/update and attachment management with dedicated types and endpoints.
This commit is contained in:
parent
e082c77946
commit
be7348c74d
4 changed files with 580 additions and 215 deletions
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue