make admin approve api
This commit is contained in:
parent
6acb536aef
commit
5d6cab229f
7 changed files with 616 additions and 1 deletions
|
|
@ -16,7 +16,8 @@ import {
|
|||
UpdateMyCourseResponse,
|
||||
DeleteMyCourseResponse,
|
||||
submitCourseResponse,
|
||||
listinstructorCourseResponse
|
||||
listinstructorCourseResponse,
|
||||
GetCourseApprovalsResponse
|
||||
} from '../types/CoursesInstructor.types';
|
||||
import { CreateCourseValidator } from "../validators/CoursesInstructor.validator";
|
||||
|
||||
|
|
@ -134,6 +135,25 @@ export class CoursesInstructorController {
|
|||
return await CoursesInstructorService.sendCourseForReview({ token, course_id: courseId });
|
||||
}
|
||||
|
||||
/**
|
||||
* ดึงประวัติการส่งอนุมัติคอร์สทั้งหมด
|
||||
* Get all course approval history
|
||||
* @param courseId - รหัสคอร์ส / Course ID
|
||||
*/
|
||||
@Get('{courseId}/approvals')
|
||||
@Security('jwt', ['instructor'])
|
||||
@SuccessResponse('200', 'Course approvals retrieved successfully')
|
||||
@Response('401', 'Invalid or expired token')
|
||||
@Response('403', 'You are not an instructor of this course')
|
||||
@Response('404', 'Course not found')
|
||||
public async getCourseApprovals(@Request() request: any, @Path() courseId: number): Promise<GetCourseApprovalsResponse> {
|
||||
const token = request.headers.authorization?.replace('Bearer ', '');
|
||||
if (!token) {
|
||||
throw new ValidationError('No token provided');
|
||||
}
|
||||
return await CoursesInstructorService.getCourseApprovals(token, courseId);
|
||||
}
|
||||
|
||||
/**
|
||||
* ดึงรายชื่อผู้สอนทั้งหมดในคอร์ส
|
||||
* Get list of all instructors in a specific course
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue