feat: Add user role retrieval, enhance recommended course filtering and detail, and introduce new k6 load tests.

This commit is contained in:
JakkrapartXD 2026-02-20 15:16:03 +07:00
parent e3873f616e
commit 45b9c6516b
11 changed files with 515 additions and 139 deletions

View file

@ -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 });
}
/**