fix: separate error messages for approved and pending course edit restrictions

This commit is contained in:
JakkrapartXD 2026-02-06 14:34:22 +07:00
parent 50ff78c594
commit 11c747edab

View file

@ -589,9 +589,12 @@ export class CoursesInstructorService {
if (!course) { if (!course) {
throw new NotFoundError('Course not found'); throw new NotFoundError('Course not found');
} }
if (course.status === 'APPROVED' || course.status === 'PENDING') { if (course.status === 'APPROVED') {
throw new ForbiddenError('Course is already approved Cannot Edit'); throw new ForbiddenError('Course is already approved Cannot Edit');
} }
if (course.status === 'PENDING') {
throw new ForbiddenError('Course is already pending Cannot Edit');
}
} }
/** /**