feat: Allow instructors to set rejected courses to draft and explicitly set course status to rejected upon administrative rejection.
All checks were successful
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 30s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 3s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 1s
Build and Deploy Frontend Management to Dev Server / Build Frontend Management Docker Image (push) Successful in 18s
Build and Deploy Frontend Management to Dev Server / Deploy E-learning Frontend Management to Dev Server (push) Successful in 3s
Build and Deploy Frontend Management to Dev Server / Notify Deployment Status (push) Successful in 1s

This commit is contained in:
JakkrapartXD 2026-02-11 17:01:17 +07:00
parent 8c40549766
commit 8edc3770eb
4 changed files with 55 additions and 4 deletions

View file

@ -21,6 +21,7 @@ import {
GetQuizAttemptDetailResponse,
GetEnrolledStudentDetailResponse,
GetCourseApprovalHistoryResponse,
setCourseDraftResponse,
} from '../types/CoursesInstructor.types';
import { CreateCourseValidator } from "../validators/CoursesInstructor.validator";
@ -189,6 +190,22 @@ export class CoursesInstructorController {
return await CoursesInstructorService.sendCourseForReview({ token, course_id: courseId });
}
/**
* DRAFT
* Set course to draft
* @param courseId - / Course ID
*/
@Post('set-draft/{courseId}')
@Security('jwt', ['instructor'])
@SuccessResponse('200', 'Course set to draft successfully')
@Response('401', 'Invalid or expired token')
@Response('404', 'Course not found')
public async setCourseDraft(@Request() request: any, @Path() courseId: number): Promise<setCourseDraftResponse> {
const token = request.headers.authorization?.replace('Bearer ', '');
if (!token) throw new ValidationError('No token provided')
return await CoursesInstructorService.setCourseDraft({ token, course_id: courseId });
}
/**
*
* Get all course approval history