fix: separate error messages for approved and pending course edit restrictions
This commit is contained in:
parent
50ff78c594
commit
11c747edab
1 changed files with 4 additions and 1 deletions
|
|
@ -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');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue