refactor: add type assertions for request parameters and explicitly type multer middleware.
This commit is contained in:
parent
04e2da43c4
commit
cad3f276f5
2 changed files with 4 additions and 4 deletions
|
|
@ -38,8 +38,8 @@ export class LessonsController {
|
|||
throw new ValidationError('No token provided');
|
||||
}
|
||||
|
||||
const courseId = parseInt(req.params.courseId, 10);
|
||||
const chapterId = parseInt(req.params.chapterId, 10);
|
||||
const courseId = parseInt(req.params.courseId as string, 10);
|
||||
const chapterId = parseInt(req.params.chapterId as string, 10);
|
||||
|
||||
if (isNaN(courseId) || isNaN(chapterId)) {
|
||||
throw new ValidationError('Invalid course ID or chapter ID');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue