add filter APPROVED to couse to see olny APPROVED course
This commit is contained in:
parent
cb1e804490
commit
6acb536aef
3 changed files with 33 additions and 18 deletions
|
|
@ -2,7 +2,6 @@ import { Body, Delete, Get, Path, Post, Put, Request, Response, Route, Security,
|
|||
import { ValidationError } from '../middleware/errorHandler';
|
||||
import { ChaptersLessonService } from '../services/ChaptersLesson.service';
|
||||
import {
|
||||
ListChaptersResponse,
|
||||
CreateChapterResponse,
|
||||
UpdateChapterResponse,
|
||||
DeleteChapterResponse,
|
||||
|
|
@ -33,22 +32,9 @@ export class ChaptersLessonInstructorController {
|
|||
|
||||
// ============================================
|
||||
// Chapter Endpoints
|
||||
// Note: Use CoursesInstructorController.getMyCourse to get chapters with full details
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* ดึง chapters ทั้งหมดของ course (พร้อม lessons)
|
||||
* Get all chapters of a course with lessons
|
||||
*/
|
||||
@Get('chapters')
|
||||
@Security('jwt', ['instructor'])
|
||||
@SuccessResponse('200', 'Chapters retrieved successfully')
|
||||
@Response('401', 'Unauthorized')
|
||||
public async listChapters(@Request() request: any, @Path() courseId: number): Promise<ListChaptersResponse> {
|
||||
const token = request.headers.authorization?.replace('Bearer ', '');
|
||||
if (!token) throw new ValidationError('No token provided');
|
||||
return await chaptersLessonService.listChapters({ token, course_id: courseId });
|
||||
}
|
||||
|
||||
/**
|
||||
* สร้าง chapter ใหม่
|
||||
* Create a new chapter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue