feat: Add user role retrieval, enhance recommended course filtering and detail, and introduce new k6 load tests.
This commit is contained in:
parent
e3873f616e
commit
45b9c6516b
11 changed files with 515 additions and 139 deletions
|
|
@ -20,10 +20,14 @@ export class RecommendedCoursesController {
|
|||
@SuccessResponse('200', 'Approved courses retrieved successfully')
|
||||
@Response('401', 'Unauthorized')
|
||||
@Response('403', 'Forbidden - Admin only')
|
||||
public async listApprovedCourses(@Request() request: any): Promise<ListApprovedCoursesResponse> {
|
||||
public async listApprovedCourses(
|
||||
@Request() request: any,
|
||||
@Query() search?: string,
|
||||
@Query() categoryId?: number
|
||||
): Promise<ListApprovedCoursesResponse> {
|
||||
const token = request.headers.authorization?.replace('Bearer ', '');
|
||||
if (!token) throw new ValidationError('No token provided');
|
||||
return await RecommendedCoursesService.listApprovedCourses(token);
|
||||
return await RecommendedCoursesService.listApprovedCourses(token, { search, categoryId });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue