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

@ -113,7 +113,7 @@ export class AdminCourseApprovalService {
/**
* Get course details for admin review
*/
static async getCourseDetail(token: string,courseId: number): Promise<GetCourseDetailForAdminResponse> {
static async getCourseDetail(token: string, courseId: number): Promise<GetCourseDetailForAdminResponse> {
try {
const course = await prisma.course.findUnique({
where: { id: courseId },
@ -133,7 +133,11 @@ export class AdminCourseApprovalService {
},
chapters: {
orderBy: { sort_order: 'asc' },
include: {
select: {
id: true,
title: true,
sort_order: true,
is_published: true,
lessons: {
orderBy: { sort_order: 'asc' },
select: {