refactor: add type assertions for request parameters and explicitly type multer middleware.

This commit is contained in:
JakkrapartXD 2026-01-20 10:03:06 +00:00
parent 04e2da43c4
commit cad3f276f5
2 changed files with 4 additions and 4 deletions

View file

@ -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');