refactor: reorder searchInstructors endpoint and fix role code to uppercase INSTRUCTOR, add lesson completion tracking on quiz pass
This commit is contained in:
parent
8e57cb124a
commit
24c37df4ef
3 changed files with 39 additions and 17 deletions
|
|
@ -43,6 +43,21 @@ export class CoursesInstructorController {
|
|||
return await CoursesInstructorService.listMyCourses(token);
|
||||
}
|
||||
|
||||
/**
|
||||
* ค้นหาผู้สอนทั้งหมดในระบบ
|
||||
* Search all instructors in database
|
||||
* @param query - คำค้นหา (email หรือ username) / Search query (email or username)
|
||||
*/
|
||||
@Get('search-instructors')
|
||||
@Security('jwt', ['instructor'])
|
||||
@SuccessResponse('200', 'Instructors found')
|
||||
@Response('401', 'Invalid or expired token')
|
||||
public async searchInstructors(@Request() request: any, @Query() query: string): Promise<SearchInstructorResponse> {
|
||||
const token = request.headers.authorization?.replace('Bearer ', '');
|
||||
if (!token) throw new ValidationError('No token provided');
|
||||
return await CoursesInstructorService.searchInstructors({ token, query });
|
||||
}
|
||||
|
||||
/**
|
||||
* ดึงข้อมูลคอร์สเฉพาะของผู้สอน (พร้อมบทเรียนและเนื้อหา)
|
||||
* Get detailed course information including chapters, lessons, attachments, and quizzes
|
||||
|
|
@ -197,21 +212,6 @@ export class CoursesInstructorController {
|
|||
return await CoursesInstructorService.listInstructorsOfCourse({ token, course_id: courseId });
|
||||
}
|
||||
|
||||
/**
|
||||
* ค้นหาผู้สอนทั้งหมดในระบบ
|
||||
* Search all instructors in database
|
||||
* @param query - คำค้นหา (email หรือ username) / Search query (email or username)
|
||||
*/
|
||||
@Get('search-instructors')
|
||||
@Security('jwt', ['instructor'])
|
||||
@SuccessResponse('200', 'Instructors found')
|
||||
@Response('401', 'Invalid or expired token')
|
||||
public async searchInstructors(@Request() request: any, @Query() query: string): Promise<SearchInstructorResponse> {
|
||||
const token = request.headers.authorization?.replace('Bearer ', '');
|
||||
if (!token) throw new ValidationError('No token provided');
|
||||
return await CoursesInstructorService.searchInstructors({ token, query });
|
||||
}
|
||||
|
||||
/**
|
||||
* เพิ่มผู้สอนเข้าในคอร์ส (ใช้ email หรือ username)
|
||||
* Add a new instructor to the course (using email or username)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue