feat: Add error audit logging to instructor course operations and implement status filtering for listing courses.
This commit is contained in:
parent
21273fcaeb
commit
45941fbe6c
4 changed files with 242 additions and 19 deletions
|
|
@ -5,6 +5,7 @@ import {
|
|||
createCourses,
|
||||
createCourseResponse,
|
||||
GetMyCourseResponse,
|
||||
ListMyCoursesInput,
|
||||
ListMyCourseResponse,
|
||||
addinstructorCourseResponse,
|
||||
removeinstructorCourseResponse,
|
||||
|
|
@ -41,12 +42,15 @@ export class CoursesInstructorController {
|
|||
@SuccessResponse('200', 'Courses retrieved successfully')
|
||||
@Response('401', 'Invalid or expired token')
|
||||
@Response('404', 'Courses not found')
|
||||
public async listMyCourses(@Request() request: any): Promise<ListMyCourseResponse> {
|
||||
public async listMyCourses(
|
||||
@Request() request: any,
|
||||
@Query() status?: 'DRAFT' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'ARCHIVED'
|
||||
): Promise<ListMyCourseResponse> {
|
||||
const token = request.headers.authorization?.replace('Bearer ', '');
|
||||
if (!token) {
|
||||
throw new ValidationError('No token provided');
|
||||
}
|
||||
return await CoursesInstructorService.listMyCourses(token);
|
||||
return await CoursesInstructorService.listMyCourses({ token, status });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue